Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/build_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
dotnet-version: |
6.x
8.x
9.x

- name: Restore dependencies
run: dotnet restore ${{ env.solution }}
Expand Down
2 changes: 1 addition & 1 deletion Directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<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="XAMLTest" Version="1.3.0-ci602" />
<PackageVersion Include="xunit" Version="2.6.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageVersion Include="Xunit.StaFact" Version="1.1.11" />
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"version": "9.0.300",
"rollForward": "latestMinor"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<IsPackable>false</IsPackable>
<SignAssembly>false</SignAssembly>
<UseWPF>true</UseWPF>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
using System.ComponentModel;
using System.ComponentModel;
using System.Globalization;
using System.Threading;

namespace MaterialDesignThemes.UITests.WPF.UpDownControls;

public class DecimalUpDownTests(ITestOutputHelper output) : TestBase(output)
{
[Fact]
public async Task NumericButtons_IncreaseAndDecreaseValue()
[Theory]
[InlineData("en-US")]
[InlineData("da-DK")]
[InlineData("fa-IR")]
[InlineData("ja-JP")]
[InlineData("zh-CN")]
public async Task NumericButtons_IncreaseAndDecreaseValue(string culture)
{
await using var recorder = new TestRecorder(App);

var numericUpDown = await LoadXaml<DecimalUpDown>("""
<materialDesign:DecimalUpDown Value="1" />
<materialDesign:DecimalUpDown Value="1" ValueStep="0.1" />
""");
await App.RemoteExecute<string>(SetCulture, [culture]);

var plusButton = await numericUpDown.GetElement<RepeatButton>("PART_IncreaseButton");
var minusButton = await numericUpDown.GetElement<RepeatButton>("PART_DecreaseButton");
var textBox = await numericUpDown.GetElement<TextBox>("PART_TextBox");
Expand All @@ -22,8 +31,8 @@ public async Task NumericButtons_IncreaseAndDecreaseValue()
await plusButton.LeftClick();
await Wait.For(async () =>
{
Assert.Equal("2", await textBox.GetText());
Assert.Equal(2, await numericUpDown.GetValue());
Assert.Equal(Convert.ToString(1.1, CultureInfo.GetCultureInfo(culture)), await textBox.GetText());
Assert.Equal((decimal)1.1, await numericUpDown.GetValue());
});

await minusButton.LeftClick();
Expand All @@ -34,6 +43,11 @@ await Wait.For(async () =>
});

recorder.Success();

static void SetCulture(Application _, string culture)
{
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(culture);
}
}

[Fact]
Expand Down
Loading