Browse Source

Add tests to ensure DesignData ctor runs

pull/55/head
Ionite 1 year ago
parent
commit
b3733262e4
No known key found for this signature in database
  1. 28
      StabilityMatrix.Tests/Avalonia/DesignDataTests.cs
  2. 3
      StabilityMatrix.Tests/StabilityMatrix.Tests.csproj

28
StabilityMatrix.Tests/Avalonia/DesignDataTests.cs

@ -0,0 +1,28 @@
using System.Reflection;
using StabilityMatrix.Avalonia.DesignData;
namespace StabilityMatrix.Tests.Avalonia;
[TestClass]
public class DesignDataTests
{
[TestInitialize]
public void TestInitialize()
{
// invoke static ctor by property access
Assert.IsNotNull(StabilityMatrix.Avalonia.DesignData.DesignData.LaunchPageViewModel);
}
// Return all properties
public static IEnumerable<object[]> DesignDataProperties =>
typeof(StabilityMatrix.Avalonia.DesignData.DesignData).GetProperties()
.Select(p => new object[] { p });
[TestMethod]
[DynamicData(nameof(DesignDataProperties))]
public void Property_ShouldBeNotNull(PropertyInfo property)
{
var value = property.GetValue(null);
Assert.IsNotNull(value);
}
}

3
StabilityMatrix.Tests/StabilityMatrix.Tests.csproj

@ -26,10 +26,13 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StabilityMatrix.Avalonia\StabilityMatrix.Avalonia.csproj" />
<ProjectReference Include="..\StabilityMatrix.Core\StabilityMatrix.Core.csproj" />
<ProjectReference Include="..\StabilityMatrix\StabilityMatrix.csproj" />
</ItemGroup>
</Project>

Loading…
Cancel
Save