diff --git a/AvantGarde.Test/AvantGarde.Test.csproj b/AvantGarde.Test/AvantGarde.Test.csproj
index 0a2f8ca..098f3ed 100644
--- a/AvantGarde.Test/AvantGarde.Test.csproj
+++ b/AvantGarde.Test/AvantGarde.Test.csproj
@@ -7,10 +7,11 @@
false
None
+
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
@@ -19,6 +20,12 @@
all
+
+
+
+
+
+
diff --git a/AvantGarde.Test/Internal/TestUtilBase.cs b/AvantGarde.Test/Internal/TestUtilBase.cs
index 5156468..b914374 100755
--- a/AvantGarde.Test/Internal/TestUtilBase.cs
+++ b/AvantGarde.Test/Internal/TestUtilBase.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -16,287 +16,288 @@
// with Avant Garde. If not, see .
// -----------------------------------------------------------------------------
+using System;
+using System.Collections.Generic;
using System.Diagnostics;
+using System.IO;
using System.Text;
+using System.Threading;
using Xunit.Abstractions;
-namespace AvantGarde.Test.Internal
+namespace AvantGarde.Test.Internal;
+
+///
+/// A base class for use with Xunit test classes which provides common utility methods and a
+/// test output helper. Test classes should derive as needed.
+///
+public class TestUtilBase : IDisposable
{
+ private static readonly object s_syncObj = new();
+ private static readonly Random s_rand = new(unchecked((int)DateTime.UtcNow.Ticks));
+ private static readonly TextWriterTraceListener s_trace = new(System.Console.Out, nameof(TestUtilBase));
+ private string? _scratch = null;
+ private readonly ITestOutputHelper? _helper = null;
+ private bool _consoleTitle;
+
///
- /// A base class for use with Xunit test classes which provides common utility methods and a
- /// test output helper. Test classes should derive as needed.
+ /// Default constructor.
///
- public class TestUtilBase : IDisposable
+ public TestUtilBase()
{
- private static readonly object s_syncObj = new object();
- private static readonly Random s_rand = new Random(unchecked((int)DateTime.UtcNow.Ticks));
- private static readonly TextWriterTraceListener s_trace = new(System.Console.Out, nameof(TestUtilBase));
- private string? _scratch = null;
- private ITestOutputHelper? _helper = null;
- private bool _consoleTitle;
-
- ///
- /// Default constructor.
- ///
- public TestUtilBase()
- {
#if DEBUG
- ConsoleOutput = true;
+ ConsoleOutput = true;
- if (Trace.Listeners.IndexOf(s_trace) < 0)
- {
- Trace.Listeners.Add(s_trace);
- }
-#endif
- }
-
- ///
- /// Constructor with specified xunit helper.
- ///
- public TestUtilBase(ITestOutputHelper helper)
- : this()
+ if (Trace.Listeners.IndexOf(s_trace) < 0)
{
- _helper = helper;
+ Trace.Listeners.Add(s_trace);
}
+#endif
+ }
+
+ ///
+ /// Constructor with specified xunit helper.
+ ///
+ public TestUtilBase(ITestOutputHelper helper)
+ : this()
+ {
+ _helper = helper;
+ }
- ///
- /// Calls .
- ///
- ~TestUtilBase()
+ ///
+ /// Calls .
+ ///
+ ~TestUtilBase()
+ {
+ Dispose(false);
+ }
+
+ ///
+ /// Gets whether to outputs to Console. The default is true for DEBUG and
+ /// false otherwise.
+ ///
+ public bool ConsoleOutput { get; } = false;
+
+ ///
+ /// Returns a scratch directory unique to the test under the user's temporary directory. The
+ /// directory is created on the first call and will initially be empty. The result will
+ /// have a trailing separator.
+ ///
+ public string Scratch
+ {
+ get
{
- Dispose(false);
+ _scratch ??= CreateScratch();
+ return _scratch;
}
+ }
+
+ ///
+ /// Gets or sets whether to delete the directory on test termination.
+ /// The default is true.
+ ///
+ public bool AutoRemoveScratch { get; set; } = true;
+
+ ///
+ /// Generates a random string or name using only uppercase ASCII letters.
+ ///
+ public static string GetRandomName(int length = 10)
+ {
+ const string SampleChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ var sb = new StringBuilder(length);
- ///
- /// Gets whether to outputs to Console. The default is true for DEBUG and
- /// false otherwise.
- ///
- public bool ConsoleOutput { get; } = false;
-
- ///
- /// Returns a scratch directory unique to the test under the user's temporary directory. The
- /// directory is created on the first call and will initially be empty. The result will
- /// have a trailing separator.
- ///
- public string Scratch
+ lock (s_syncObj)
{
- get
+ for (int n = 0; n < length; ++n)
{
- _scratch ??= CreateScratch();
- return _scratch;
+ sb.Append(SampleChars[s_rand.Next(SampleChars.Length)]);
}
}
- ///
- /// Gets or sets whether to delete the directory on test termination.
- /// The default is true.
- ///
- public bool AutoRemoveScratch { get; set; } = true;
-
- ///
- /// Generates a random string or name using only uppercase ASCII letters.
- ///
- public static string GetRandomName(int length = 10)
- {
- const string SampleChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ return sb.ToString();
+ }
- var sb = new StringBuilder(length);
+ ///
+ /// Creates a new randomly named scratch directory under the
+ /// directory. The result will have a trailing separator.
+ ///
+ public string CreateNewScratch()
+ {
+ string path = Scratch + GetRandomName();
+ Directory.CreateDirectory(path);
+ return path + Path.DirectorySeparatorChar;
+ }
- lock (s_syncObj)
- {
- for (int n = 0; n < length; ++n)
- {
- sb.Append(SampleChars[s_rand.Next(SampleChars.Length)]);
- }
- }
+ ///
+ /// Creates randomly named file under directory containing the text
+ /// content supplied. Returns the path of the file created. Equivalent to:
+ /// CreateFileContent("", content)
+ ///
+ public string CreateFileContent(string content, Encoding? enc = null)
+ {
+ return CreateFileContent(string.Empty, content, enc);
+ }
- return sb.ToString();
- }
+ ///
+ /// Creates randomly named file under directory containing the text
+ /// content supplied. Returns the path of the file created. Equivalent to:
+ /// CreateFileContent(null, lines)
+ ///
+ public string CreateFileContent(IEnumerable lines, Encoding? enc = null)
+ {
+ return CreateFileContent(string.Empty, lines, enc);
+ }
- ///
- /// Creates a new randomly named scratch directory under the
- /// directory. The result will have a trailing separator.
- ///
- public string CreateNewScratch()
- {
- string path = Scratch + GetRandomName();
- Directory.CreateDirectory(path);
- return path + Path.DirectorySeparatorChar;
- }
+ ///
+ /// Creates a text file with the given text content using default UTF8 encoding, overwriting
+ /// any existing file. If the filename path is not rooted, the file will be created under
+ /// directory. If filename is null or empty, a random one is
+ /// generated. The full path is returned.
+ ///
+ public string CreateFileContent(string filename, string content, Encoding? enc = null)
+ {
+ enc ??= Encoding.UTF8;
- ///
- /// Creates randomly named file under directory containing the text
- /// content supplied. Returns the path of the file created. Equivalent to:
- /// CreateFileContent("", content)
- ///
- public string CreateFileContent(string content, Encoding? enc = null)
+ if (string.IsNullOrEmpty(filename))
{
- return CreateFileContent(string.Empty, content, enc);
+ filename = GetRandomName();
}
- ///
- /// Creates randomly named file under directory containing the text
- /// content supplied. Returns the path of the file created. Equivalent to:
- /// CreateFileContent(null, lines)
- ///
- public string CreateFileContent(IEnumerable lines, Encoding? enc = null)
+ if (!Path.IsPathRooted(filename))
{
- return CreateFileContent(string.Empty, lines, enc);
+ filename = Scratch + filename;
}
- ///
- /// Creates a text file with the given text content using default UTF8 encoding, overwriting
- /// any existing file. If the filename path is not rooted, the file will be created under
- /// directory. If filename is null or empty, a random one is
- /// generated. The full path is returned.
- ///
- public string CreateFileContent(string filename, string content, Encoding? enc = null)
- {
- enc ??= Encoding.UTF8;
-
- if (string.IsNullOrEmpty(filename))
- {
- filename = GetRandomName();
- }
+ using var writer = new StreamWriter(File.Open(filename, FileMode.Create, FileAccess.Write, FileShare.Read), enc);
+ writer.Write(content);
- if (!Path.IsPathRooted(filename))
- {
- filename = Scratch + filename;
- }
-
- using (var writer = new StreamWriter(File.Open(filename, FileMode.Create, FileAccess.Write, FileShare.Read)))
- {
- writer.Write(content);
- }
+ return filename;
+ }
- return filename;
- }
+ ///
+ /// Creates a text file with the given text lines using default UTF8 encoding. Each line
+ /// will be terminated with the Environment.NewLine value. Otherwise equivalent to:
+ /// CreateFileContent(path, content).
+ ///
+ public string CreateFileContent(string filename, IEnumerable lines, Encoding? enc = null)
+ {
+ string content = string.Empty;
- ///
- /// Creates a text file with the given text lines using default UTF8 encoding. Each line
- /// will be terminated with the Environment.NewLine value. Otherwise equivalent to:
- /// CreateFileContent(path, content).
- ///
- public string CreateFileContent(string filename, IEnumerable lines, Encoding? enc = null)
+ if (lines != null)
{
- string content = string.Empty;
-
- if (lines != null)
+ foreach (var line in lines)
{
- foreach (var line in lines)
+ if (line != null)
{
- if (line != null)
- {
- content += line.TrimEnd('\r', '\n') + Environment.NewLine;
- }
+ content += line.TrimEnd('\r', '\n') + Environment.NewLine;
}
}
-
- return CreateFileContent(filename, content, enc);
}
- ///
- /// Simple sleep.
- ///
- public void Sleep(int ms)
+ return CreateFileContent(filename, content, enc);
+ }
+
+ ///
+ /// Simple sleep.
+ ///
+ public static void Sleep(int ms)
+ {
+ Thread.Sleep(ms);
+ }
+
+ ///
+ /// Writes a new line to the output.
+ ///
+ public void WriteLine()
+ {
+ _helper?.WriteLine(string.Empty);
+
+ if (ConsoleOutput)
{
- Thread.Sleep(ms);
+ WriteTitle();
+ Console.WriteLine();
}
+ }
- ///
- /// Writes a new line to the output.
- ///
- public void WriteLine()
- {
- _helper?.WriteLine(string.Empty);
+ ///
+ /// Formats a line of text and writes it to the output.
+ ///
+ public void WriteLine(object? msg, params object[] args)
+ {
+ msg ??= string.Empty;
+ var s = msg.ToString();
- if (ConsoleOutput)
- {
- WriteTitle();
- Console.WriteLine();
- }
+ if (args.Length != 0)
+ {
+ _helper?.WriteLine(s, args);
+ }
+ else
+ {
+ _helper?.WriteLine(s);
}
- ///
- /// Formats a line of text and writes it to the output.
- ///
- public void WriteLine(object? msg, params object[] args)
+ if (ConsoleOutput)
{
- msg ??= string.Empty;
- var s = msg.ToString();
+ WriteTitle();
if (args.Length != 0)
{
- _helper?.WriteLine(s, args);
+ Console.WriteLine(s ?? string.Empty, args);
}
else
{
- _helper?.WriteLine(s);
- }
-
- if (ConsoleOutput)
- {
- WriteTitle();
-
- if (args.Length != 0)
- {
- Console.WriteLine(s ?? string.Empty, args);
- }
- else
- {
- Console.WriteLine(s ?? string.Empty);
- }
+ Console.WriteLine(s ?? string.Empty);
}
}
+ }
- private void WriteTitle()
+ private void WriteTitle()
+ {
+ if (!_consoleTitle)
{
- if (!_consoleTitle)
- {
- _consoleTitle = true;
- Console.WriteLine();
- Console.WriteLine();
+ _consoleTitle = true;
+ Console.WriteLine();
+ Console.WriteLine();
- Console.Write("TEST: ");
- Console.WriteLine(GetType().Name);
- }
+ Console.Write("TEST: ");
+ Console.WriteLine(GetType().Name);
}
+ }
- ///
- /// Calls protected .
- ///
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
+ ///
+ /// Calls protected .
+ ///
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
- ///
- /// The base implementation deletes the directory, and overriding
- /// methods should, therefore, call the base implementation.
- ///
- protected virtual void Dispose(bool _)
+ ///
+ /// The base implementation deletes the directory, and overriding
+ /// methods should, therefore, call the base implementation.
+ ///
+ protected virtual void Dispose(bool _)
+ {
+ if (_scratch != null && AutoRemoveScratch)
{
- if (_scratch != null && AutoRemoveScratch)
+ try
+ {
+ Directory.Delete(_scratch, true);
+ }
+ catch
{
- try
- {
- Directory.Delete(_scratch, true);
- }
- catch
- {
- }
}
-
- _scratch = null;
}
- private string CreateScratch()
- {
- var path = Path.GetTempPath() + GetType().Name + "-" + GetRandomName() + Path.DirectorySeparatorChar;
- Directory.CreateDirectory(path);
- return path;
- }
+ _scratch = null;
+ }
+ private string CreateScratch()
+ {
+ var path = Path.GetTempPath() + GetType().Name + "-" + GetRandomName() + Path.DirectorySeparatorChar;
+ Directory.CreateDirectory(path);
+ return path;
}
+
}
diff --git a/AvantGarde.Test/Markup/MarkupDictionaryTest.cs b/AvantGarde.Test/Markup/MarkupDictionaryTest.cs
index 284f7f7..116116a 100644
--- a/AvantGarde.Test/Markup/MarkupDictionaryTest.cs
+++ b/AvantGarde.Test/Markup/MarkupDictionaryTest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -22,96 +22,95 @@
using Xunit;
using Xunit.Abstractions;
-namespace AvantGarde.Markup.Test
+namespace AvantGarde.Markup.Test;
+
+public class MarkupDictionaryTest : TestUtilBase
{
- public class MarkupDictionaryTest : TestUtilBase
+ public MarkupDictionaryTest(ITestOutputHelper helper)
+ : base(helper)
+ {
+ }
+
+ [Fact]
+ public void Types_NotEmpty()
+ {
+ Assert.NotEmpty(MarkupDictionary.Types);
+ WriteLine(string.Join(", ", MarkupDictionary.Types.Keys));
+ }
+
+ [Fact]
+ public void GetMarkupInfo_TextBlock()
+ {
+ var info = AssertControlInfo(typeof(TextBlock));
+ WriteLine(info.GetHelpDocument());
+ WriteLine();
+
+ WriteLine(info.Attributes["DoubleTapped"].GetHelpDocument());
+ WriteLine();
+
+ WriteLine(info.Attributes["Height"].GetHelpDocument());
+ WriteLine();
+
+ var a = info.Attributes["Text"];
+ Assert.NotEmpty(a.GetHelpDocument());
+ WriteLine(a.GetHelpDocument());
+ WriteLine();
+
+ a = info.Attributes["FontSize"];
+ Assert.NotEmpty(a.GetHelpDocument());
+ WriteLine(a.GetHelpDocument());
+ WriteLine();
+
+ a = info.Attributes["MinWidth"];
+ Assert.NotEmpty(a.GetHelpDocument());
+ WriteLine(a.GetHelpDocument());
+ WriteLine();
+
+ a = info.Attributes["Cursor"];
+ Assert.NotEmpty(a.GetHelpDocument());
+ WriteLine(a.GetHelpDocument());
+ WriteLine();
+
+ a = info.Attributes["VerticalAlignment"];
+ Assert.NotEmpty(a.GetHelpDocument());
+ WriteLine(a.GetHelpDocument());
+ WriteLine();
+ }
+
+ [Fact]
+ public void GetMarkupInfo_Grid()
{
- public MarkupDictionaryTest(ITestOutputHelper helper)
- : base(helper)
- {
- }
-
- [Fact]
- public void Types_NotEmpty()
- {
- Assert.NotEmpty(MarkupDictionary.Types);
- WriteLine(string.Join(", ", MarkupDictionary.Types.Keys));
- }
-
- [Fact]
- public void GetMarkupInfo_TextBlock()
- {
- var info = AssertControlInfo(typeof(TextBlock));
- WriteLine(info.GetHelpDocument());
- WriteLine();
-
- WriteLine(info.Attributes["DoubleTapped"].GetHelpDocument());
- WriteLine();
-
- WriteLine(info.Attributes["Height"].GetHelpDocument());
- WriteLine();
-
- var a = info.Attributes["Text"];
- Assert.NotEmpty(a.GetHelpDocument());
- WriteLine(a.GetHelpDocument());
- WriteLine();
-
- a = info.Attributes["FontSize"];
- Assert.NotEmpty(a.GetHelpDocument());
- WriteLine(a.GetHelpDocument());
- WriteLine();
-
- a = info.Attributes["MinWidth"];
- Assert.NotEmpty(a.GetHelpDocument());
- WriteLine(a.GetHelpDocument());
- WriteLine();
-
- a = info.Attributes["Cursor"];
- Assert.NotEmpty(a.GetHelpDocument());
- WriteLine(a.GetHelpDocument());
- WriteLine();
-
- a = info.Attributes["VerticalAlignment"];
- Assert.NotEmpty(a.GetHelpDocument());
- WriteLine(a.GetHelpDocument());
- WriteLine();
- }
-
- [Fact]
- public void GetMarkupInfo_Grid()
- {
- var info = AssertControlInfo(typeof(Grid));
- WriteLine(info.GetHelpDocument());
- WriteLine();
- }
-
- [Fact]
- public void GetMarkupInfo_Window()
- {
- var info = AssertControlInfo(typeof(Window));
- WriteLine(info.GetHelpDocument());
- WriteLine();
- }
-
- private MarkupInfo AssertControlInfo(Type type)
- {
- var name = type.Name;
- var info = MarkupDictionary.GetMarkupInfo(name) ??
- throw new ArgumentNullException(name);
-
- Assert.Equal(name, info.Name);
- Assert.Equal(type, info.ClassType);
- Assert.True(info.Attributes.Count > 0);
- Assert.NotEmpty(info.GetHelpDocument());
-
- Assert.False(info.Attributes["Height"].IsEvent);
- Assert.NotEmpty(info.Attributes["Height"].GetHelpDocument());
-
- Assert.True(info.Attributes["DoubleTapped"].IsEvent);
- Assert.NotEmpty(info.Attributes["DoubleTapped"].GetHelpDocument());
-
- return info;
- }
+ var info = AssertControlInfo(typeof(Grid));
+ WriteLine(info.GetHelpDocument());
+ WriteLine();
+ }
+
+ [Fact]
+ public void GetMarkupInfo_Window()
+ {
+ var info = AssertControlInfo(typeof(Window));
+ WriteLine(info.GetHelpDocument());
+ WriteLine();
+ }
+
+ private static MarkupInfo AssertControlInfo(Type type)
+ {
+ var name = type.Name;
+ var info = MarkupDictionary.GetMarkupInfo(name) ??
+ throw new ArgumentNullException(name);
+
+ Assert.Equal(name, info.Name);
+ Assert.Equal(type, info.ClassType);
+ Assert.True(info.Attributes.Count > 0);
+ Assert.NotEmpty(info.GetHelpDocument());
+
+ Assert.False(info.Attributes["Height"].IsEvent);
+ Assert.NotEmpty(info.Attributes["Height"].GetHelpDocument());
+ Assert.True(info.Attributes["DoubleTapped"].IsEvent);
+ Assert.NotEmpty(info.Attributes["DoubleTapped"].GetHelpDocument());
+
+ return info;
}
+
}
\ No newline at end of file
diff --git a/AvantGarde.Test/Markup/SchemaGeneratorTest.cs b/AvantGarde.Test/Markup/SchemaGeneratorTest.cs
index 55ee19e..893f406 100644
--- a/AvantGarde.Test/Markup/SchemaGeneratorTest.cs
+++ b/AvantGarde.Test/Markup/SchemaGeneratorTest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -21,44 +21,43 @@
using Xunit;
using Xunit.Abstractions;
-namespace AvantGarde.Markup.Test
+namespace AvantGarde.Markup.Test;
+
+public class SchemaGeneratorTest : TestUtilBase
{
- public class SchemaGeneratorTest : TestUtilBase
+ public SchemaGeneratorTest(ITestOutputHelper helper)
+ : base(helper)
{
- public SchemaGeneratorTest(ITestOutputHelper helper)
- : base(helper)
- {
- }
-
- [Fact]
- public void GetSchema()
- {
- var schema = SchemaGenerator.GetSchema(false, false);
- var schemaF = SchemaGenerator.GetSchema(true, false);
- var schemaA = SchemaGenerator.GetSchema(false, true);
- var schemaFA = SchemaGenerator.GetSchema(true, true);
+ }
- Assert.NotEqual(schema, schemaF);
- Assert.NotEqual(schema, schemaA);
- Assert.NotEqual(schema, schemaFA);
- Assert.NotEqual(schemaA, schemaF);
- }
+ [Fact]
+ public void GetSchema()
+ {
+ var schema = SchemaGenerator.GetSchema(false, false);
+ var schemaF = SchemaGenerator.GetSchema(true, false);
+ var schemaA = SchemaGenerator.GetSchema(false, true);
+ var schemaFA = SchemaGenerator.GetSchema(true, true);
- [Fact]
- public void SaveDocument()
- {
- SchemaGenerator.SaveDocument("Avalonia.xsd", false);
- SchemaGenerator.SaveDocument("Avalonia.Formatted.xsd", true);
- }
+ Assert.NotEqual(schema, schemaF);
+ Assert.NotEqual(schema, schemaA);
+ Assert.NotEqual(schema, schemaFA);
+ Assert.NotEqual(schemaA, schemaF);
+ }
- [Fact]
- public void ScratchText()
- {
- var temp = new Control();
- WriteLine(temp.Width);
- WriteLine(temp.MinWidth);
- WriteLine(temp.MaxWidth);
- }
+ [Fact]
+ public void SaveDocument()
+ {
+ SchemaGenerator.SaveDocument("Avalonia.xsd", false);
+ SchemaGenerator.SaveDocument("Avalonia.Formatted.xsd", true);
+ }
+ [Fact]
+ public void ScratchText()
+ {
+ var temp = new Control();
+ WriteLine(temp.Width);
+ WriteLine(temp.MinWidth);
+ WriteLine(temp.MaxWidth);
}
+
}
\ No newline at end of file
diff --git a/AvantGarde.Test/Projects/DotnetProjectTest.cs b/AvantGarde.Test/Projects/DotnetProjectTest.cs
index 2ef91d1..cb6e8e7 100644
--- a/AvantGarde.Test/Projects/DotnetProjectTest.cs
+++ b/AvantGarde.Test/Projects/DotnetProjectTest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -16,179 +16,180 @@
// with Avant Garde. If not, see .
// -----------------------------------------------------------------------------
+using System;
+using System.IO;
using AvantGarde.Test.Internal;
using Xunit;
using Xunit.Abstractions;
-namespace AvantGarde.Projects.Test
+namespace AvantGarde.Projects.Test;
+
+public class DotnetProjectTest : TestUtilBase
{
- public class DotnetProjectTest : TestUtilBase
+ private const string ProjectNet5 =
+ "net5.0" +
+ "";
+ private const string ProjectNet6 =
+ "net6.0" +
+ "";
+
+ public DotnetProjectTest(ITestOutputHelper helper)
+ : base(helper)
{
- private const string ProjectNet5 =
- "net5.0" +
- "";
- private const string ProjectNet6 =
- "net6.0" +
- "";
-
- public DotnetProjectTest(ITestOutputHelper helper)
- : base(helper)
- {
- }
-
- [Fact]
- public void Refresh_Updates()
- {
- var path = CreateFileContent("Name.Test.csproj", ProjectNet5);
- var item = new DotnetProject(path);
-
- Assert.NotEqual(0, item.GetHashCode());
- Assert.Equal("Name.Test", item.ProjectName);
- Assert.Equal("Name.Test.csproj", item.Name);
- Assert.Equal(PathKind.Solution, item.Kind);
- Assert.Equal(path, item.FullName);
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
-
- Assert.Empty(item.TargetFramework);
- Assert.Empty(item.AvaloniaVersion);
- Assert.False(item.AssemblyPath?.Exists == true);
-
- // First refresh
- int code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.Equal("net5.0", item.TargetFramework);
- Assert.False(item.AssemblyPath?.Exists == true);
-
- // Again (no change)
- code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.Equal("net5.0", item.TargetFramework);
- Assert.False(item.AssemblyPath?.Exists == true);
-
- // Create assembly
- path = Scratch + "bin/debug/net5.0";
- Directory.CreateDirectory(path);
- path = CreateFileContent(path + "/Name.Test.dll", "Dummy");
-
- // Assembly now exists
- code = item.GetHashCode();
-
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.Equal("net5.0", item.TargetFramework);
- Assert.Equal("0.10.11", item.AvaloniaVersion);
-
- WriteLine(item.AssemblyPath?.FullName);
- Assert.True(item.AssemblyPath?.Exists == true);
- Assert.Contains("net5.0", item.AssemblyPath?.FullName);
-
- // Change framework
- path = CreateFileContent("Name.Test.csproj", ProjectNet6);
-
- // Assembly not exist because we switch to .NET6
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.Equal("net6.0", item.TargetFramework);
- Assert.False(item.AssemblyPath?.Exists == true);
-
- // Create it
- path = Scratch + "bin/debug/net6.0";
- Directory.CreateDirectory(path);
- path = CreateFileContent(path + "/Name.Test.dll", "Dummy");
-
- // Assembly now exists
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.Equal("net6.0", item.TargetFramework);
- Assert.Equal("0.10.12", item.AvaloniaVersion);
- Assert.True(item.AssemblyPath?.Exists == true);
- Assert.Contains("net6.0", item.AssemblyPath?.FullName);
-
- // Again (no change)
- code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.Equal("net6.0", item.TargetFramework);
- Assert.True(item.AssemblyPath?.Exists == true);
- Assert.Contains("net6.0", item.AssemblyPath?.FullName);
-
- // Update assembly file
- CreateFileContent(path, "DummyChange");
-
- // Changed
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.Equal("net6.0", item.TargetFramework);
- Assert.True(item.AssemblyPath?.Exists == true);
- }
-
- [Fact]
- public void Refresh_Artifacts()
- {
- var solDir = Path.Combine(Scratch, "Solution");
- var projDir = Path.Combine(solDir, "Name.Test");
- Directory.CreateDirectory(projDir);
-
- var path = CreateFileContent(Path.Combine(projDir, "Name.Test.csproj"), ProjectNet6);
- var item = new DotnetProject(path);
-
- Assert.True(item.Refresh());
- Assert.Equal("net6.0", item.TargetFramework);
- Assert.False(item.AssemblyPath?.Exists == true);
-
- // Now put in dummy solution ABOVE project (where artifacts live)
- CreateFileContent(Path.Combine(solDir, "Name.Test.sln"), "Dummy");
-
- item.Refresh();
- Assert.Equal("net6.0", item.TargetFramework);
- Assert.False(item.AssemblyPath?.Exists == true);
-
- // Create assembly under artifacts
- // debug_net8.0/projectName.dll
- // artifacts/bin/debug/projectName.dll
- // artifacts/bin/[projectName]/debug_net8.0/projectName.dll
- var artDir = Path.Combine(solDir, "artifacts", "bin", "debug");
- Directory.CreateDirectory(artDir);
- path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
-
- // Exists now
- item.Refresh();
- Assert.True(item.AssemblyPath?.Exists == true);
-
- // New location
- Directory.Delete(artDir, true);
- artDir = Path.Combine(solDir, "artifacts", "bin", "debug_net6.0");
-
- Directory.CreateDirectory(artDir);
- path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
-
- item.Refresh();
- Assert.True(item.AssemblyPath?.Exists == true);
-
- // New location
- Directory.Delete(artDir, true);
- artDir = Path.Combine(solDir, "artifacts", "bin", "Name.Test", "debug_net6.0");
- Directory.CreateDirectory(artDir);
- path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
-
- item.Refresh();
- Assert.True(item.AssemblyPath?.Exists == true);
-
- // New location
- Directory.Delete(artDir, true);
- artDir = Path.Combine(solDir, "artifacts/bin/Name.Test/debug/net6.0");
- Directory.CreateDirectory(artDir);
- path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
-
- item.Refresh();
- Assert.True(item.AssemblyPath?.Exists == true);
- }
+ }
+ [Fact]
+ public void Refresh_Updates()
+ {
+ var path = CreateFileContent("Name.Test.csproj", ProjectNet5);
+ var item = new DotnetProject(path);
+
+ Assert.NotEqual(0, item.GetHashCode());
+ Assert.Equal("Name.Test", item.ProjectName);
+ Assert.Equal("Name.Test.csproj", item.Name);
+ Assert.Equal(PathKind.Solution, item.Kind);
+ Assert.Equal(path, item.FullName);
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+
+ Assert.Empty(item.TargetFramework);
+ Assert.Empty(item.AvaloniaVersion);
+ Assert.False(item.AssemblyPath?.Exists == true);
+
+ // First refresh
+ int code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.Equal("net5.0", item.TargetFramework);
+ Assert.False(item.AssemblyPath?.Exists == true);
+
+ // Again (no change)
+ code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.Equal("net5.0", item.TargetFramework);
+ Assert.False(item.AssemblyPath?.Exists == true);
+
+ // Create assembly
+ path = Scratch + "bin/debug/net5.0";
+ Directory.CreateDirectory(path);
+ path = CreateFileContent(path + "/Name.Test.dll", "Dummy");
+
+ // Assembly now exists
+ code = item.GetHashCode();
+
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.Equal("net5.0", item.TargetFramework);
+ Assert.Equal("0.10.11", item.AvaloniaVersion);
+
+ WriteLine(item.AssemblyPath?.FullName);
+ Assert.True(item.AssemblyPath?.Exists == true);
+ Assert.Contains("net5.0", item.AssemblyPath?.FullName);
+
+ // Change framework
+ path = CreateFileContent("Name.Test.csproj", ProjectNet6);
+
+ // Assembly not exist because we switch to .NET6
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.Equal("net6.0", item.TargetFramework);
+ Assert.False(item.AssemblyPath?.Exists == true);
+
+ // Create it
+ path = Scratch + "bin/debug/net6.0";
+ Directory.CreateDirectory(path);
+ path = CreateFileContent(path + "/Name.Test.dll", "Dummy");
+
+ // Assembly now exists
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.Equal("net6.0", item.TargetFramework);
+ Assert.Equal("0.10.12", item.AvaloniaVersion);
+ Assert.True(item.AssemblyPath?.Exists == true);
+ Assert.Contains("net6.0", item.AssemblyPath?.FullName);
+
+ // Again (no change)
+ code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.Equal("net6.0", item.TargetFramework);
+ Assert.True(item.AssemblyPath?.Exists == true);
+ Assert.Contains("net6.0", item.AssemblyPath?.FullName);
+
+ // Update assembly file
+ CreateFileContent(path, "DummyChange");
+
+ // Changed
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.Equal("net6.0", item.TargetFramework);
+ Assert.True(item.AssemblyPath?.Exists == true);
}
+
+ [Fact]
+ public void Refresh_Artifacts()
+ {
+ var solDir = Path.Combine(Scratch, "Solution");
+ var projDir = Path.Combine(solDir, "Name.Test");
+ Directory.CreateDirectory(projDir);
+
+ var path = CreateFileContent(Path.Combine(projDir, "Name.Test.csproj"), ProjectNet6);
+ var item = new DotnetProject(path);
+
+ Assert.True(item.Refresh());
+ Assert.Equal("net6.0", item.TargetFramework);
+ Assert.False(item.AssemblyPath?.Exists == true);
+
+ // Now put in dummy solution ABOVE project (where artifacts live)
+ CreateFileContent(Path.Combine(solDir, "Name.Test.sln"), "Dummy");
+
+ item.Refresh();
+ Assert.Equal("net6.0", item.TargetFramework);
+ Assert.False(item.AssemblyPath?.Exists == true);
+
+ // Create assembly under artifacts
+ // debug_net8.0/projectName.dll
+ // artifacts/bin/debug/projectName.dll
+ // artifacts/bin/[projectName]/debug_net8.0/projectName.dll
+ var artDir = Path.Combine(solDir, "artifacts", "bin", "debug");
+ Directory.CreateDirectory(artDir);
+ path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
+
+ // Exists now
+ item.Refresh();
+ Assert.True(item.AssemblyPath?.Exists == true);
+
+ // New location
+ Directory.Delete(artDir, true);
+ artDir = Path.Combine(solDir, "artifacts", "bin", "debug_net6.0");
+
+ Directory.CreateDirectory(artDir);
+ path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
+
+ item.Refresh();
+ Assert.True(item.AssemblyPath?.Exists == true);
+
+ // New location
+ Directory.Delete(artDir, true);
+ artDir = Path.Combine(solDir, "artifacts", "bin", "Name.Test", "debug_net6.0");
+ Directory.CreateDirectory(artDir);
+ path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
+
+ item.Refresh();
+ Assert.True(item.AssemblyPath?.Exists == true);
+
+ // New location
+ Directory.Delete(artDir, true);
+ artDir = Path.Combine(solDir, "artifacts/bin/Name.Test/debug/net6.0");
+ Directory.CreateDirectory(artDir);
+ path = CreateFileContent(Path.Combine(artDir, "Name.Test.dll"), "Dummy");
+
+ item.Refresh();
+ Assert.True(item.AssemblyPath?.Exists == true);
+ }
+
}
\ No newline at end of file
diff --git a/AvantGarde.Test/Projects/NodeItemTest.cs b/AvantGarde.Test/Projects/NodeItemTest.cs
index c15f0b1..c70ec0d 100644
--- a/AvantGarde.Test/Projects/NodeItemTest.cs
+++ b/AvantGarde.Test/Projects/NodeItemTest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -16,228 +16,229 @@
// with Avant Garde. If not, see .
// -----------------------------------------------------------------------------
+using System;
+using System.IO;
using AvantGarde.Test.Internal;
using Xunit;
using Xunit.Abstractions;
-namespace AvantGarde.Projects.Test
+namespace AvantGarde.Projects.Test;
+
+public class NodeItemTest : TestUtilBase
{
- public class NodeItemTest : TestUtilBase
+ public NodeItemTest(ITestOutputHelper helper)
+ : base(helper)
+ {
+ }
+
+ [Fact]
+ public void Refresh_UpdatesForFile()
+ {
+ var path = CreateFileContent("Text.txt", "Hello");
+ var item = new NodeItem(path, PathKind.AnyFile);
+
+ // Initial
+ Assert.Equal(PathKind.Document, item.Kind);
+ Assert.Equal("Text.txt", item.Name);
+ Assert.Equal(path, item.FullName);
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.NotEqual(0, item.GetHashCode());
+
+ Assert.Empty(item.Contents);
+ Assert.Equal(1, item.TotalFiles);
+
+ // First refresh
+ int code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.Equal(1, item.TotalFiles);
+
+ // Again no change
+ code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.Equal(1, item.TotalFiles);
+
+ // Update
+ CreateFileContent(path, "Hello World");
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.Equal(1, item.TotalFiles);
+
+ // Delete
+ File.Delete(path);
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.False(item.Exists);
+ Assert.Equal(0, item.TotalFiles);
+ Assert.Equal(default, item.LastUtc);
+ }
+
+ [Fact]
+ public void Refresh_UpdatesForDirectory()
+ {
+ var temp = PathItem.CleanPath(CreateNewScratch());
+ var sub = Directory.CreateDirectory(temp + "sub") + "/";
+ var item = new NodeItem(temp, PathKind.Directory);
+
+ // Important
+ item.Properties.ShowEmptyDirectories = true;
+
+ Assert.Equal(PathKind.Directory, item.Kind);
+ Assert.NotEmpty(item.Name);
+ Assert.Equal(temp, item.FullName);
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.NotEqual(0, item.GetHashCode());
+
+ Assert.Empty(item.Contents);
+ Assert.Equal(0, item.TotalFiles);
+ Assert.NotEmpty(item.Properties.FilePatterns);
+ Assert.NotEmpty(item.Properties.ExcludeDirectories);
+
+ // First refresh
+ int code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.Equal(0, item.TotalFiles);
+ Assert.Single(item.Contents);
+
+ // Create file in sub-directory
+ var file = CreateFileContent(sub + "Text.txt", "Hello");
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.Equal(1, item.TotalFiles);
+ Assert.Single(item.Contents);
+
+ // Again no change
+ code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.Equal(1, item.TotalFiles);
+ Assert.Single(item.Contents);
+
+ // Two new files
+ code = item.GetHashCode();
+ CreateFileContent(temp + "Text1.txt", "Hello World");
+ CreateFileContent(temp + "Text2.txt", "Hello World");
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.Equal(3, item.TotalFiles);
+ Assert.Equal(3, item.Contents.Count);
+
+ // Delete
+ code = item.GetHashCode();
+ File.Delete(file);
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.Equal(2, item.TotalFiles);
+ Assert.Equal(3, item.Contents.Count);
+ }
+
+ [Fact]
+ public void ExcludedDirectories_Excludes()
+ {
+ var temp = PathItem.CleanPath(CreateNewScratch());
+ var sub = Directory.CreateDirectory(temp + "Exclude") + "/";
+ CreateFileContent(sub + "Text1.txt", "Hello World");
+
+ var item = new NodeItem(Scratch, PathKind.Directory);
+ Assert.True(item.Refresh());
+
+ // Has the file
+ Assert.Equal(1, item.TotalFiles);
+
+ item.Properties.ExcludeDirectories = "Exclude";
+ Assert.True(item.Refresh());
+
+ // Now it doesn't
+ Assert.Equal(0, item.TotalFiles);
+ }
+
+ [Fact]
+ public void FilePattern_FiltersOnPattern()
{
- public NodeItemTest(ITestOutputHelper helper)
- : base(helper)
- {
- }
-
- [Fact]
- public void Refresh_UpdatesForFile()
- {
- var path = CreateFileContent("Text.txt", "Hello");
- var item = new NodeItem(path, PathKind.AnyFile);
-
- // Initial
- Assert.Equal(PathKind.Document, item.Kind);
- Assert.Equal("Text.txt", item.Name);
- Assert.Equal(path, item.FullName);
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.NotEqual(0, item.GetHashCode());
-
- Assert.Empty(item.Contents);
- Assert.Equal(1, item.TotalFiles);
-
- // First refresh
- int code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.Equal(1, item.TotalFiles);
-
- // Again no change
- code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.Equal(1, item.TotalFiles);
-
- // Update
- CreateFileContent(path, "Hello World");
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.Equal(1, item.TotalFiles);
-
- // Delete
- File.Delete(path);
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.False(item.Exists);
- Assert.Equal(0, item.TotalFiles);
- Assert.Equal(default(DateTime), item.LastUtc);
- }
-
- [Fact]
- public void Refresh_UpdatesForDirectory()
- {
- var temp = PathItem.CleanPath(CreateNewScratch());
- var sub = Directory.CreateDirectory(temp + "sub") + "/";
- var item = new NodeItem(temp, PathKind.Directory);
-
- // Important
- item.Properties.ShowEmptyDirectories = true;
-
- Assert.Equal(PathKind.Directory, item.Kind);
- Assert.NotEmpty(item.Name);
- Assert.Equal(temp, item.FullName);
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.NotEqual(0, item.GetHashCode());
-
- Assert.Empty(item.Contents);
- Assert.Equal(0, item.TotalFiles);
- Assert.NotEmpty(item.Properties.FilePatterns);
- Assert.NotEmpty(item.Properties.ExcludeDirectories);
-
- // First refresh
- int code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.Equal(0, item.TotalFiles);
- Assert.Single(item.Contents);
-
- // Create file in sub-directory
- var file = CreateFileContent(sub + "Text.txt", "Hello");
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.Equal(1, item.TotalFiles);
- Assert.Single(item.Contents);
-
- // Again no change
- code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.Equal(1, item.TotalFiles);
- Assert.Single(item.Contents);
-
- // Two new files
- code = item.GetHashCode();
- CreateFileContent(temp + "Text1.txt", "Hello World");
- CreateFileContent(temp + "Text2.txt", "Hello World");
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.Equal(3, item.TotalFiles);
- Assert.Equal(3, item.Contents.Count);
-
- // Delete
- code = item.GetHashCode();
- File.Delete(file);
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.Equal(2, item.TotalFiles);
- Assert.Equal(3, item.Contents.Count);
- }
-
- [Fact]
- public void ExcludedDirectories_Excludes()
- {
- var temp = PathItem.CleanPath(CreateNewScratch());
- var sub = Directory.CreateDirectory(temp + "Exclude") + "/";
- CreateFileContent(sub + "Text1.txt", "Hello World");
-
- var item = new NodeItem(Scratch, PathKind.Directory);
- Assert.True(item.Refresh());
-
- // Has the file
- Assert.Equal(1, item.TotalFiles);
-
- item.Properties.ExcludeDirectories = "Exclude";
- Assert.True(item.Refresh());
-
- // Now it doesn't
- Assert.Equal(0, item.TotalFiles);
- }
-
- [Fact]
- public void FilePattern_FiltersOnPattern()
- {
- var temp = PathItem.CleanPath(CreateNewScratch());
- var sub = Directory.CreateDirectory(temp + "SubDir") + "/";
- CreateFileContent(sub + "Text1.txt", "Hello World");
- CreateFileContent(sub + "Text1.axaml", "Hello World");
-
- var item = new NodeItem(Scratch, PathKind.Directory);
- Assert.True(item.Refresh());
- WriteLine(item.Properties.FilePatterns);
- WriteLine(item.ToString(true));
-
- // Has both
- Assert.Equal(2, item.TotalFiles);
- item.Properties.FilePatterns = "*.axaml";
- Assert.True(item.Refresh());
-
- // Now has 1
- Assert.Equal(1, item.TotalFiles);
- }
-
- [Fact]
- public void FindDirectory_FindsName()
- {
- var temp = CreateNewScratch() + "sub";
- var sub = Directory.CreateDirectory(temp) + "/";
- CreateFileContent(sub + "Text1.txt", "Hello World");
-
- var item = new NodeItem(Scratch, PathKind.Directory);
- item.Refresh();
-
- Assert.Null(item.FindDirectory("NotExist"));
- Assert.Null(item.FindDirectory("Text1.txt"));
-
- Assert.Equal(temp, item.FindDirectory(temp)?.FullName);
- Assert.Equal(temp, item.FindDirectory(temp.ToUpperInvariant(), StringComparison.InvariantCultureIgnoreCase)?.FullName);
- }
-
- [Fact]
- public void FindFile_FindsName()
- {
- var temp = CreateNewScratch() + "sub";
- var sub = Directory.CreateDirectory(temp) + "/";
- CreateFileContent(sub + "Text1.txt", "Hello World");
-
- var item = new NodeItem(Scratch, PathKind.Directory);
- item.Refresh();
-
- Assert.Null(item.FindFile("NotExist"));
- Assert.Equal("Text1.txt", item.FindFile("Text1.txt")?.Name);
- Assert.Equal("Text1.txt", item.FindFile("TEXT1.txt", StringComparison.OrdinalIgnoreCase)?.Name);
- }
-
- [Fact]
- public void FindNode_FindsPath()
- {
- var temp = CreateNewScratch();
- var sub = Directory.CreateDirectory(temp + "sub") + "/";
- var path = CreateFileContent(sub + "Text1.txt", "Hello World");
-
- var item = new NodeItem(Scratch, PathKind.Directory);
- item.Refresh();
-
- Assert.Null(item.FindNode("NotExist"));
- Assert.Null(item.FindNode(""));
-
- Assert.Equal("Text1.txt", item.FindNode(path)?.Name);
- Assert.Equal("Text1.txt", item.FindNode(path.ToUpperInvariant(), StringComparison.OrdinalIgnoreCase)?.Name);
- }
+ var temp = PathItem.CleanPath(CreateNewScratch());
+ var sub = Directory.CreateDirectory(temp + "SubDir") + "/";
+ CreateFileContent(sub + "Text1.txt", "Hello World");
+ CreateFileContent(sub + "Text1.axaml", "Hello World");
+
+ var item = new NodeItem(Scratch, PathKind.Directory);
+ Assert.True(item.Refresh());
+ WriteLine(item.Properties.FilePatterns);
+ WriteLine(item.ToString(true));
+
+ // Has both
+ Assert.Equal(2, item.TotalFiles);
+ item.Properties.FilePatterns = "*.axaml";
+ Assert.True(item.Refresh());
+
+ // Now has 1
+ Assert.Equal(1, item.TotalFiles);
+ }
+
+ [Fact]
+ public void FindDirectory_FindsName()
+ {
+ var temp = CreateNewScratch() + "sub";
+ var sub = Directory.CreateDirectory(temp) + "/";
+ CreateFileContent(sub + "Text1.txt", "Hello World");
+
+ var item = new NodeItem(Scratch, PathKind.Directory);
+ item.Refresh();
+
+ Assert.Null(item.FindDirectory("NotExist"));
+ Assert.Null(item.FindDirectory("Text1.txt"));
+ Assert.Equal(temp, item.FindDirectory(temp)?.FullName);
+ Assert.Equal(temp, item.FindDirectory(temp.ToUpperInvariant(), StringComparison.InvariantCultureIgnoreCase)?.FullName);
}
+
+ [Fact]
+ public void FindFile_FindsName()
+ {
+ var temp = CreateNewScratch() + "sub";
+ var sub = Directory.CreateDirectory(temp) + "/";
+ CreateFileContent(sub + "Text1.txt", "Hello World");
+
+ var item = new NodeItem(Scratch, PathKind.Directory);
+ item.Refresh();
+
+ Assert.Null(item.FindFile("NotExist"));
+ Assert.Equal("Text1.txt", item.FindFile("Text1.txt")?.Name);
+ Assert.Equal("Text1.txt", item.FindFile("TEXT1.txt", StringComparison.OrdinalIgnoreCase)?.Name);
+ }
+
+ [Fact]
+ public void FindNode_FindsPath()
+ {
+ var temp = CreateNewScratch();
+ var sub = Directory.CreateDirectory(temp + "sub") + "/";
+ var path = CreateFileContent(sub + "Text1.txt", "Hello World");
+
+ var item = new NodeItem(Scratch, PathKind.Directory);
+ item.Refresh();
+
+ Assert.Null(item.FindNode("NotExist"));
+ Assert.Null(item.FindNode(""));
+
+ Assert.Equal("Text1.txt", item.FindNode(path)?.Name);
+ Assert.Equal("Text1.txt", item.FindNode(path.ToUpperInvariant(), StringComparison.OrdinalIgnoreCase)?.Name);
+ }
+
}
diff --git a/AvantGarde.Test/Projects/PathItemTest.cs b/AvantGarde.Test/Projects/PathItemTest.cs
index ce11279..9b09879 100755
--- a/AvantGarde.Test/Projects/PathItemTest.cs
+++ b/AvantGarde.Test/Projects/PathItemTest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -24,226 +24,225 @@
using Xunit;
using Xunit.Abstractions;
-namespace AvantGarde.Projects.Test
+namespace AvantGarde.Projects.Test;
+
+public class PathItemTest : TestUtilBase
{
- public class PathItemTest : TestUtilBase
+ public PathItemTest(ITestOutputHelper helper)
+ : base(helper)
{
- public PathItemTest(ITestOutputHelper helper)
- : base(helper)
- {
- }
+ }
- [Fact]
- public void Refresh_UpdatesForFile()
- {
- var path = CreateFileContent("Text.txt", "Hello");
- var item = new PathItem(path, PathKind.AnyFile);
-
- // Initial
- Assert.Equal(PathKind.Document, item.Kind);
- Assert.Equal("Text.txt", item.Name);
- Assert.Equal(path, item.FullName);
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.True(item.Length > 0);
- Assert.NotEqual(0, item.GetHashCode());
-
- // No change
- int code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.True(item.Length > 0);
-
- // Update
- code = item.GetHashCode();
- CreateFileContent(path, "Hello World");
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.True(item.Length > 0);
-
- // No change
- code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.True(item.Length > 0);
-
- // Delete
- File.Delete(path);
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.False(item.Exists);
- Assert.Equal(default(DateTime), item.LastUtc);
- Assert.Equal(0, item.Length);
- }
+ [Fact]
+ public void Refresh_UpdatesForFile()
+ {
+ var path = CreateFileContent("Text.txt", "Hello");
+ var item = new PathItem(path, PathKind.AnyFile);
+
+ // Initial
+ Assert.Equal(PathKind.Document, item.Kind);
+ Assert.Equal("Text.txt", item.Name);
+ Assert.Equal(path, item.FullName);
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.True(item.Length > 0);
+ Assert.NotEqual(0, item.GetHashCode());
+
+ // No change
+ int code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.True(item.Length > 0);
+
+ // Update
+ code = item.GetHashCode();
+ CreateFileContent(path, "Hello World");
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.True(item.Length > 0);
+
+ // No change
+ code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.True(item.Length > 0);
+
+ // Delete
+ File.Delete(path);
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.False(item.Exists);
+ Assert.Equal(default, item.LastUtc);
+ Assert.Equal(0, item.Length);
+ }
- [Fact]
- public void Refresh_UpdatesForDirectory()
- {
- var path = Scratch + "test";
- Directory.CreateDirectory(path);
- var item = new PathItem(path, PathKind.Directory);
-
- Assert.Equal(PathKind.Directory, item.Kind);
- Assert.NotEmpty(item.Name);
- Assert.False(item.Name.EndsWith('/'));
- Assert.Equal(path, item.FullName);
- Assert.True(item.Exists);
- Assert.NotEqual(default(DateTime), item.LastUtc);
- Assert.Equal(0, item.Length);
- Assert.NotEqual(0, item.GetHashCode());
-
- // No change
- int code = item.GetHashCode();
- Assert.False(item.Refresh());
- Assert.Equal(code, item.GetHashCode());
- Assert.True(item.Exists);
- Assert.Equal(0, item.Length);
-
- // Delete
- Directory.Delete(item.FullName);
- code = item.GetHashCode();
- Assert.True(item.Refresh());
- Assert.NotEqual(code, item.GetHashCode());
- Assert.False(item.Exists);
- Assert.Equal(default(DateTime), item.LastUtc);
- Assert.Equal(0, item.Length);
- }
+ [Fact]
+ public void Refresh_UpdatesForDirectory()
+ {
+ var path = Scratch + "test";
+ Directory.CreateDirectory(path);
+ var item = new PathItem(path, PathKind.Directory);
+
+ Assert.Equal(PathKind.Directory, item.Kind);
+ Assert.NotEmpty(item.Name);
+ Assert.False(item.Name.EndsWith('/'));
+ Assert.Equal(path, item.FullName);
+ Assert.True(item.Exists);
+ Assert.NotEqual(default, item.LastUtc);
+ Assert.Equal(0, item.Length);
+ Assert.NotEqual(0, item.GetHashCode());
+
+ // No change
+ int code = item.GetHashCode();
+ Assert.False(item.Refresh());
+ Assert.Equal(code, item.GetHashCode());
+ Assert.True(item.Exists);
+ Assert.Equal(0, item.Length);
+
+ // Delete
+ Directory.Delete(item.FullName);
+ code = item.GetHashCode();
+ Assert.True(item.Refresh());
+ Assert.NotEqual(code, item.GetHashCode());
+ Assert.False(item.Exists);
+ Assert.Equal(default, item.LastUtc);
+ Assert.Equal(0, item.Length);
+ }
- [Fact]
- public void CopyConstructor_File()
- {
- var path = CreateFileContent("Text.cs", "Hello");
- var item = new PathItem(path, PathKind.AnyFile);
- item.Refresh();
-
- File.Delete(path);
- var copy = new PathItem(item);
-
- Assert.Equal(PathKind.CSharp, copy.Kind);
- Assert.Equal("Text.cs", copy.Name);
- Assert.Equal(path, copy.FullName);
- Assert.True(copy.Exists);
- Assert.NotEqual(default(DateTime), copy.LastUtc);
- Assert.Equal(item.Length, copy.Length);
- Assert.Equal(item.GetHashCode(), copy.GetHashCode());
-
- // Change because have deleted
- Assert.True(copy.Refresh());
- Assert.False(copy.Exists);
- Assert.Equal(default(DateTime), copy.LastUtc);
- Assert.Equal(0, copy.Length);
- Assert.NotEqual(item.GetHashCode(), copy.GetHashCode());
- }
+ [Fact]
+ public void CopyConstructor_File()
+ {
+ var path = CreateFileContent("Text.cs", "Hello");
+ var item = new PathItem(path, PathKind.AnyFile);
+ item.Refresh();
+
+ File.Delete(path);
+ var copy = new PathItem(item);
+
+ Assert.Equal(PathKind.CSharp, copy.Kind);
+ Assert.Equal("Text.cs", copy.Name);
+ Assert.Equal(path, copy.FullName);
+ Assert.True(copy.Exists);
+ Assert.NotEqual(default, copy.LastUtc);
+ Assert.Equal(item.Length, copy.Length);
+ Assert.Equal(item.GetHashCode(), copy.GetHashCode());
+
+ // Change because have deleted
+ Assert.True(copy.Refresh());
+ Assert.False(copy.Exists);
+ Assert.Equal(default, copy.LastUtc);
+ Assert.Equal(0, copy.Length);
+ Assert.NotEqual(item.GetHashCode(), copy.GetHashCode());
+ }
- [Fact]
- public void CopyConstructor_Directory()
- {
- var item = new PathItem(Scratch, PathKind.Directory);
- var copy = new PathItem(item);
-
- Assert.Equal(PathKind.Directory, copy.Kind);
- Assert.NotEmpty(copy.Name);
- Assert.False(copy.Name.EndsWith('/'));
- Assert.Equal(PathItem.CleanPath(Scratch), copy.FullName);
- Assert.True(copy.Exists);
- Assert.NotEqual(default(DateTime), copy.LastUtc);
- Assert.Equal(0, copy.Length);
- Assert.Equal(item.GetHashCode(), copy.GetHashCode());
-
- Assert.False(copy.Refresh());
- Assert.True(copy.Exists);
- Assert.NotEqual(default(DateTime), copy.LastUtc);
- Assert.Equal(0, copy.Length);
- Assert.Equal(item.GetHashCode(), copy.GetHashCode());
- }
+ [Fact]
+ public void CopyConstructor_Directory()
+ {
+ var item = new PathItem(Scratch, PathKind.Directory);
+ var copy = new PathItem(item);
+
+ Assert.Equal(PathKind.Directory, copy.Kind);
+ Assert.NotEmpty(copy.Name);
+ Assert.False(copy.Name.EndsWith('/'));
+ Assert.Equal(PathItem.CleanPath(Scratch), copy.FullName);
+ Assert.True(copy.Exists);
+ Assert.NotEqual(default, copy.LastUtc);
+ Assert.Equal(0, copy.Length);
+ Assert.Equal(item.GetHashCode(), copy.GetHashCode());
+
+ Assert.False(copy.Refresh());
+ Assert.True(copy.Exists);
+ Assert.NotEqual(default, copy.LastUtc);
+ Assert.Equal(0, copy.Length);
+ Assert.Equal(item.GetHashCode(), copy.GetHashCode());
+ }
- [Fact]
- public void Constructor_RootExist()
+ [Fact]
+ public void Constructor_RootExist()
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- var item = new PathItem("C:\\", PathKind.Directory);
- Assert.Equal("C:\\", item.Name);
- Assert.Equal("C:\\", item.FullName);
- Assert.Equal("", item.ParentDirectory);
- }
- else
- {
- var item = new PathItem("/", PathKind.Directory);
- Assert.Equal("/", item.Name);
- Assert.Equal("/", item.FullName);
- Assert.Equal("", item.ParentDirectory);
- }
+ var item = new PathItem("C:\\", PathKind.Directory);
+ Assert.Equal("C:\\", item.Name);
+ Assert.Equal("C:\\", item.FullName);
+ Assert.Equal("", item.ParentDirectory);
}
-
- [Fact]
- public void Constructor_EmptyPathThrows()
+ else
{
- Assert.Throws(() => new PathItem("", PathKind.Document));
- Assert.Throws(() => new PathItem("", PathKind.Directory));
+ var item = new PathItem("/", PathKind.Directory);
+ Assert.Equal("/", item.Name);
+ Assert.Equal("/", item.FullName);
+ Assert.Equal("", item.ParentDirectory);
}
+ }
- [Fact]
- public void Exists_FileNotFound()
- {
- var item = new PathItem("Kdiehde/djiedah.png", PathKind.AnyFile);
- Assert.Equal(PathKind.Image, item.Kind);
- Assert.False(item.Exists);
- }
+ [Fact]
+ public void Constructor_EmptyPathThrows()
+ {
+ Assert.Throws(() => new PathItem("", PathKind.Document));
+ Assert.Throws(() => new PathItem("", PathKind.Directory));
+ }
- [Fact]
- public void Exists_DirectoryNotFound()
- {
- var item = new PathItem("Kdiehde/djiedah.cs", PathKind.Directory);
- Assert.Equal(PathKind.Directory, item.Kind);
- Assert.False(item.Exists);
- }
+ [Fact]
+ public void Exists_FileNotFound()
+ {
+ var item = new PathItem("Kdiehde/djiedah.png", PathKind.AnyFile);
+ Assert.Equal(PathKind.Image, item.Kind);
+ Assert.False(item.Exists);
+ }
- [Fact]
- public void ReadAsText_ReadsUtf8()
- {
- var content = "Hello World£";
- var path = CreateFileContent(content, Encoding.UTF8);
- var item = new PathItem(path, PathKind.AnyFile);
- Assert.Equal(content, item.ReadAsText().Trim());
- }
+ [Fact]
+ public void Exists_DirectoryNotFound()
+ {
+ var item = new PathItem("Kdiehde/djiedah.cs", PathKind.Directory);
+ Assert.Equal(PathKind.Directory, item.Kind);
+ Assert.False(item.Exists);
+ }
- [Fact]
- public void ReadAsText_ReadsLatin1()
- {
- var content = "Hello World£";
- var path = CreateFileContent("temp.txt", content, Encoding.Latin1);
- var item = new PathItem(path, PathKind.AnyFile);
- Assert.Equal(content, item.ReadAsText().Trim());
- }
+ [Fact]
+ public void ReadAsText_ReadsUtf8()
+ {
+ var content = "Hello World£";
+ var path = CreateFileContent(content, Encoding.UTF8);
+ var item = new PathItem(path, PathKind.AnyFile);
+ Assert.Equal(content, item.ReadAsText().Trim());
+ }
- [Fact]
- public void ReadAsText_ReadsUnicode()
- {
- var content = "Hello World£";
- var path = CreateFileContent("temp.txt", content, Encoding.Unicode);
- var item = new PathItem(path, PathKind.AnyFile);
- Assert.Equal(content, item.ReadAsText().Trim());
- }
+ [Fact]
+ public void ReadAsText_ReadsLatin1()
+ {
+ var content = "Hello World£";
+ var path = CreateFileContent("temp.txt", content, Encoding.Latin1);
+ var item = new PathItem(path, PathKind.AnyFile);
+ Assert.Equal(content, item.ReadAsText().Trim());
+ }
- [Fact]
- public void ReadAsText_ThrowsIfDirectory()
- {
- var item = new PathItem(Scratch, PathKind.Directory);
- Assert.Throws(() => item.ReadAsText());
- }
+ [Fact]
+ public void ReadAsText_ReadsUnicode()
+ {
+ var content = "Hello World£";
+ var path = CreateFileContent("temp.txt", content, Encoding.Unicode);
+ var item = new PathItem(path, PathKind.AnyFile);
+ Assert.Equal(content, item.ReadAsText().Trim());
+ }
- [Fact]
- public void ReadAsText_ThrowsIfFileNotFound()
- {
- var path = Scratch + "NotFound.txt";
- var item = new PathItem(path, PathKind.AnyFile);
- Assert.Throws(() => { item.ReadAsText(); });
- }
+ [Fact]
+ public void ReadAsText_ThrowsIfDirectory()
+ {
+ var item = new PathItem(Scratch, PathKind.Directory);
+ Assert.Throws(() => item.ReadAsText());
+ }
+ [Fact]
+ public void ReadAsText_ThrowsIfFileNotFound()
+ {
+ var path = Scratch + "NotFound.txt";
+ var item = new PathItem(path, PathKind.AnyFile);
+ Assert.Throws(() => { item.ReadAsText(); });
}
+
}
diff --git a/AvantGarde.Test/Utility/TypeExtensionTest.cs b/AvantGarde.Test/Utility/TypeExtensionTest.cs
index 3c8f124..c75ed34 100644
--- a/AvantGarde.Test/Utility/TypeExtensionTest.cs
+++ b/AvantGarde.Test/Utility/TypeExtensionTest.cs
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------------
// PROJECT : Avant Garde
-// COPYRIGHT : Andy Thomas (C) 2022
+// COPYRIGHT : Andy Thomas (C) 2022-23
// LICENSE : GPL-3.0-or-later
// HOMEPAGE : https://github.com/kuiperzone/AvantGarde
//
@@ -16,39 +16,37 @@
// with Avant Garde. If not, see .
// -----------------------------------------------------------------------------
-using System;
using Avalonia.Controls;
using AvantGarde.Test.Internal;
using Xunit;
using Xunit.Abstractions;
-namespace AvantGarde.Utility.Test
+namespace AvantGarde.Utility.Test;
+
+public class TypeExtensionTest : TestUtilBase
{
- public class TypeExtensionTest : TestUtilBase
+ public TypeExtensionTest(ITestOutputHelper helper)
+ : base(helper)
{
- public TypeExtensionTest(ITestOutputHelper helper)
- : base(helper)
- {
- }
+ }
- [Fact]
- public void GetFriendlyType_TupleInt()
- {
- var temp = typeof(Tuple);
- var name = temp.GetFriendlyName();
+ [Fact]
+ public void GetFriendlyType_TupleInt()
+ {
+ var temp = typeof(Tuple);
+ var name = temp.GetFriendlyName();
- WriteLine(name);
- Assert.Equal("Tuple", name);
- }
+ WriteLine(name);
+ Assert.Equal("Tuple", name);
+ }
- [Fact]
- public void GetFriendlyType_GenericEvent()
- {
- var temp = typeof(TextBlock).GetEvent("PointerMoved");
- var name = temp?.EventHandlerType.GetFriendlyName();
+ [Fact]
+ public void GetFriendlyType_GenericEvent()
+ {
+ var temp = typeof(TextBlock).GetEvent("PointerMoved");
+ var name = temp?.EventHandlerType.GetFriendlyName();
- WriteLine(name);
- Assert.Equal("EventHandler", name);
- }
+ WriteLine(name);
+ Assert.Equal("EventHandler", name);
}
}
\ No newline at end of file
diff --git a/AvantGarde.pupnet.conf b/AvantGarde.pupnet.conf
index 2ad7de2..8a64233 100644
--- a/AvantGarde.pupnet.conf
+++ b/AvantGarde.pupnet.conf
@@ -1,13 +1,13 @@
-# PUPNET DEPLOY: 1.5.0
+# PUPNET DEPLOY: 1.6.0
# APP PREAMBLE
AppBaseName = AvantGarde
AppFriendlyName = Avant Garde
AppId = zone.kuiper.AvantGarde
-AppVersionRelease = 1.2.2[1]
+AppVersionRelease = 1.3.0.2
AppShortSummary = A cross-platform XAML Previewer for the Avalonia .NET Framework
AppDescription = """
- Avant Garde is a XAML previewer for the C# Avalonia Framework. Avant Garde is a standalone application,
+ Avant Garde is a XAML previewer for the C# Avalonia Framework. It is a standalone application,
rather than an IDE extension. This means you can use it in conjunction with any IDE.
"""
AppLicenseId = GPL-3.0-or-later
diff --git a/AvantGarde/App.axaml b/AvantGarde/App.axaml
index 43269c4..c2b96a0 100644
--- a/AvantGarde/App.axaml
+++ b/AvantGarde/App.axaml
@@ -4,11 +4,9 @@
xmlns:vm="using:AvantGarde.ViewModels"
x:DataType="vm:AvantViewModel"
+ RequestedThemeVariant="Default"
x:Class="AvantGarde.App">
-
-
-
@@ -31,7 +29,7 @@