Skip to content

Commit 251d01c

Browse files
committed
Updates test framework and fixes assertions
Updates test framework from Fact to Test. Updates tests to use Assert.That for improved readability and consistency.
1 parent 5281f9e commit 251d01c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

tests/MaterialDesignThemes.UITests/WPF/AutoSuggestBoxes/AutoSuggestTextBoxTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public async Task AutoSuggestBox_KeysUpAndDown_WrapAround()
197197
await Assert.That(await suggestionListBox.GetSelectedIndex()).IsEqualTo(0);
198198
}
199199

200-
[Fact]
200+
[Test]
201201
[Description("Issue 3845")]
202202
public async Task AutoSuggestBox_SelectingAnItem_SetsSelectedItem()
203203
{
@@ -217,12 +217,12 @@ public async Task AutoSuggestBox_SelectingAnItem_SetsSelectedItem()
217217

218218
//Assert
219219
string? selectedItem = (await suggestBox.GetSelectedItem()) as string;
220-
Assert.Equal("Bananas", selectedItem);
220+
await Assert.That(selectedItem).IsEqualTo("Bananas");
221221

222-
static void AssertViewModelProperty(AutoSuggestBox autoSuggestBox)
222+
static async Task AssertViewModelProperty(AutoSuggestBox autoSuggestBox)
223223
{
224224
var viewModel = (AutoSuggestTextBoxWithCollectionViewViewModel)autoSuggestBox.DataContext;
225-
Assert.Equal("Bananas", viewModel.SelectedItem);
225+
await Assert.That(viewModel.SelectedItem).IsEqualTo("Bananas");
226226
}
227227
await suggestBox.RemoteExecute(AssertViewModelProperty);
228228

tests/MaterialDesignThemes.UITests/WPF/Theme/ThemeTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public async Task WhenUsingCustomColorThemeDictionary_AllBrushesApplied()
6363
[MatrixDataSource]
6464
public async Task BundledTheme_UsesSameColorsAsXamlResources(
6565
[Matrix("Light", "Dark")] string baseTheme,
66-
[MatrixMethod<PrimaryColor>(nameof(PrimaryColors))] PrimaryColor primaryColor,
67-
[MatrixMethod<SecondaryColor>(nameof(SecondaryColors))] SecondaryColor secondaryColor)
66+
[MatrixMethod<ThemeTests>(nameof(PrimaryColors))] PrimaryColor primaryColor,
67+
[MatrixMethod<ThemeTests>(nameof(SecondaryColors))] SecondaryColor secondaryColor)
6868
{
6969
IVisualElement<WrapPanel> bundledPanel = await Initialize($"""
7070
<materialDesign:BundledTheme BaseTheme="{baseTheme}"

tests/MaterialDesignThemes.UITests/WPF/UpDownControls/NumericUpDownTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public async Task NumericUpDown_WhenValueEqualsMinimum_DisableButtons(int value,
222222
recorder.Success();
223223
}
224224

225-
[Fact]
225+
[Test]
226226
[Description("Issue 3827")]
227227
public async Task NumericUpDown_WhenBindingUpdateTriggerIsPropertyChanged_ItUpdatesBeforeLoosingFocus()
228228
{
@@ -241,12 +241,12 @@ public async Task NumericUpDown_WhenBindingUpdateTriggerIsPropertyChanged_ItUpda
241241
object? tag = await numericUpDown.GetTag();
242242

243243
//Assert
244-
Assert.Equal("4", tag?.ToString());
244+
await Assert.That(tag?.ToString()).IsEqualTo("4");
245245

246246
recorder.Success();
247247
}
248248

249-
[Fact]
249+
[Test]
250250
[Description("Issue 3827")]
251251
public async Task NumericUpDown_WhenBindingUpdateTriggerIsLostFocus_ItDoesNotUpdateUntilItLoosesFocus()
252252
{
@@ -286,8 +286,8 @@ static int GetViewModelValue(NumericUpDown numericUpDown)
286286

287287

288288
//Assert
289-
Assert.Equal("2", valueBeforeLostFocus.ToString());
290-
Assert.Equal("4", valueAfterLostFocus.ToString());
289+
await Assert.That(valueBeforeLostFocus.ToString()).IsEqualTo("2");
290+
await Assert.That(valueAfterLostFocus.ToString()).IsEqualTo("4");
291291

292292
recorder.Success();
293293
}

0 commit comments

Comments
 (0)