Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Directory.packages.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<ItemGroup>
<PackageVersion Include="BluwolfIcons" Version="1.0.1" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageVersion Include="Dragablz" Version="0.0.3.234" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="MahApps.Metro" Version="2.4.10" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
Expand All @@ -24,11 +24,12 @@
<PackageVersion Include="ShowMeTheXAML.MSBuild" Version="2.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="VirtualizingWrapPanel" Version="1.5.8" />
<PackageVersion Include="XAMLTest" Version="1.2.2" />
<PackageVersion Include="xunit" Version="2.6.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
<PackageVersion Include="Xunit.StaFact" Version="2.0.36-alpha" />
<PackageVersion Include="xunit.v3" Version="1.1.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<TargetFrameworks>net472;net6.0-windows;net8.0-windows</TargetFrameworks>
<AssemblyTitle>MaterialDesignColors.Wpf.Tests</AssemblyTitle>
<Product>MaterialDesignColors.Wpf.Tests</Product>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net472'">
<Reference Include="PresentationCore" />
Expand All @@ -25,9 +28,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="System.Net.Http" />
<PackageReference Include="System.Private.Uri" />
<PackageReference Include="System.Text.RegularExpressions" />
<PackageReference Include="Shouldly" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Shouldly;
using Xunit;

namespace MaterialDesignColors.Wpf.Fixture;
namespace MaterialDesignColors.Wpf.Tests;

public class ResourceProviderFixture
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<UseWPF>true</UseWPF>
<NoWarn>$(NoWarn);CA1707</NoWarn>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<!--<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>-->
</PropertyGroup>

Expand All @@ -19,18 +22,17 @@
<PackageReference Include="System.Net.Http" />
<PackageReference Include="System.Text.RegularExpressions" />
<PackageReference Include="XAMLTest" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" />
</ItemGroup>

<ItemGroup>
<Using Include="MaterialDesignThemes.Wpf" />
<Using Include="XamlTest" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions tests/MaterialDesignThemes.UITests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected async Task<IVisualElement> LoadUserControl(Type userControlType)
return await App.CreateWindowWithUserControl(userControlType);
}

public async Task InitializeAsync() =>
public async ValueTask InitializeAsync() =>
App = await XamlTest.App.StartRemote(new AppOptions
{
#if !DEBUG
Expand All @@ -55,5 +55,6 @@ public async Task InitializeAsync() =>
AllowVisualStudioDebuggerAttach = AttachedDebuggerToRemoteProcess,
LogMessage = Output.WriteLine
});
public async Task DisposeAsync() => await App.DisposeAsync();

public async ValueTask DisposeAsync() => await App.DisposeAsync();
}
Original file line number Diff line number Diff line change
Expand Up @@ -862,24 +862,24 @@ public async Task TopLevelItemWithNestedExpandedChild_MovesChildrenMaintainingEx
await item1.LeftClickExpander();

//NB: Needs to be long enough delay so the next click does not register as a double click
await Task.Delay(1000);
await Task.Delay(1000, TestContext.Current.CancellationToken);

// Add children to item "1_1" and expand
IVisualElement<TreeListViewItem> item11 = await treeListView.GetElement<TreeListViewItem>("/TreeListViewItem[3]");
await AddChildren(item11, 3, addButton);
await item11.LeftClickExpander();

//NB: Needs to be long enough delay so the next click does not register as a double click
await Task.Delay(1000);
await Task.Delay(1000, TestContext.Current.CancellationToken);

//Move parent item down
await item1.LeftClick();
await upButton.LeftClick();

await Task.Delay(1000);
await Task.Delay(1000, TestContext.Current.CancellationToken);

await downButton.LeftClick();
await Task.Delay(1000);
await Task.Delay(1000, TestContext.Current.CancellationToken);

//Assert the child was successfully moved
await AssertTreeItemContent(treeListView, 0, "0");
Expand Down
1 change: 0 additions & 1 deletion tests/MaterialDesignThemes.Wpf.Tests/DialogHostTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.ComponentModel;
using System.Threading;
using System.Windows.Threading;
using Xunit;

namespace MaterialDesignThemes.Wpf.Tests;

Expand Down
10 changes: 6 additions & 4 deletions tests/MaterialDesignThemes.Wpf.Tests/EnumDataAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Reflection;
using Xunit.Sdk;
using Xunit.v3;

namespace MaterialDesignThemes.Wpf.Tests;

public class EnumDataAttribute : DataAttribute
{
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
public override ValueTask<IReadOnlyCollection<ITheoryDataRow>> GetData(MethodInfo testMethod, DisposalTracker disposalTracker)
{
ParameterInfo[] parameters = testMethod.GetParameters();
if (parameters.Length != 1 ||
Expand All @@ -14,14 +15,15 @@ public override IEnumerable<object[]> GetData(MethodInfo testMethod)
throw new Exception($"{testMethod.DeclaringType?.FullName}.{testMethod.Name} must have a single enum parameter");
}

return GetDataImplementation(parameters[0].ParameterType);
return new([..GetDataImplementation(parameters[0].ParameterType)]);

static IEnumerable<object[]> GetDataImplementation(Type parameterType)
static IEnumerable<ITheoryDataRow> GetDataImplementation(Type parameterType)
{
foreach (object enumValue in Enum.GetValues(parameterType).OfType<object>())
{
yield return new[] { enumValue };
yield return new TheoryDataRow(enumValue);
}
}
}
public override bool SupportsDiscoveryEnumeration() => true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<TargetFrameworks>net472;net6.0-windows;net8.0-windows</TargetFrameworks>
<AssemblyTitle>MaterialDesignThemes.Wpf.Tests</AssemblyTitle>
<Product>MaterialDesignThemes.Wpf.Tests</Product>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<OutputType>Exe</OutputType>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net472'">
<Reference Include="PresentationCore" />
Expand All @@ -26,8 +30,13 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="System.Net.Http" />
<PackageReference Include="System.Text.RegularExpressions" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" />
<PackageReference Include="Xunit.StaFact" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>
Expand Down
Loading