diff --git a/Directory.Packages.props b/Directory.Packages.props index ace54f5b35..81facd4feb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -18,7 +18,6 @@ - diff --git a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml index efd8158017..71a62a1fb6 100644 --- a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml +++ b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml @@ -10128,7 +10128,7 @@ - Gets or sets the delay (in milliseconds). + Gets or sets the delay (in milliseconds). Default is 300. @@ -10168,7 +10168,7 @@ Callback for when the tooltip is dismissed. - + diff --git a/tests/Core/Anchor/FluentAnchorTests.cs b/tests/Core/Anchor/FluentAnchorTests.cs index 88d868038e..717a485ff7 100644 --- a/tests/Core/Anchor/FluentAnchorTests.cs +++ b/tests/Core/Anchor/FluentAnchorTests.cs @@ -1,5 +1,4 @@ using Bunit; -using FluentAssertions; using Microsoft.Extensions.DependencyInjection; using Xunit; @@ -148,11 +147,10 @@ public void FluentAnchor_TargetAttribute(string target) // Assert if (target == "invalid") { - action.Should().Throw(); + Assert.Throws< ArgumentException>(action); } else { - action.Should().NotThrow(); cut!.Verify(suffix: target); } } diff --git a/tests/Core/Badge/FluentBadgeTests.cs b/tests/Core/Badge/FluentBadgeTests.cs index 0d99e36030..0bd659ec27 100644 --- a/tests/Core/Badge/FluentBadgeTests.cs +++ b/tests/Core/Badge/FluentBadgeTests.cs @@ -1,5 +1,5 @@ using Bunit; -using FluentAssertions; + using Xunit; namespace Microsoft.FluentUI.AspNetCore.Components.Tests.Badge; @@ -42,11 +42,10 @@ public void FluentBadge_AppearanceAttribute(Appearance appearance) // Assert if (appearance == Appearance.Hypertext) { - action.Should().Throw(); + Assert.Throws(action); } else { - action.Should().NotThrow(); cut!.Verify(suffix: appearance.ToString()); } } @@ -69,7 +68,7 @@ public void ThrowArgumentException_When_AppearanceAttributeValue_IsInvalid(Appea }; // Assert - action.Should().ThrowExactly(); + Assert.Throws(action); } [Fact] diff --git a/tests/Core/Breadcrumb/FluentBreadcrumbItemTests.cs b/tests/Core/Breadcrumb/FluentBreadcrumbItemTests.cs index 805f67a968..f6bb1d6638 100644 --- a/tests/Core/Breadcrumb/FluentBreadcrumbItemTests.cs +++ b/tests/Core/Breadcrumb/FluentBreadcrumbItemTests.cs @@ -1,5 +1,5 @@ using Bunit; -using FluentAssertions; + using Xunit; namespace Microsoft.FluentUI.AspNetCore.Components.Tests.Breadcrumb; @@ -133,11 +133,10 @@ public void FluentBreadcrumbItem_TargetAttribute(string targetAttribute) // Assert if (targetAttribute == "invalid") { - action.Should().Throw(); + Assert.Throws(action); } else { - action.Should().NotThrow(); cut!.Verify(suffix: targetAttribute); } } diff --git a/tests/Core/Button/FluentButtonTests.cs b/tests/Core/Button/FluentButtonTests.cs index 4d50390d94..f5cf3d4bfd 100644 --- a/tests/Core/Button/FluentButtonTests.cs +++ b/tests/Core/Button/FluentButtonTests.cs @@ -1,5 +1,5 @@ using Bunit; -using FluentAssertions; + using Microsoft.Extensions.DependencyInjection; using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions; using Xunit; @@ -165,7 +165,7 @@ public void Throw_ArgumentException_When_FormTargetAttribute_IsInvalid(string? f }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Theory] diff --git a/tests/Core/DataGrid/DataGridSortByTests.razor b/tests/Core/DataGrid/DataGridSortByTests.razor index 71e8578c00..964bbefce1 100644 --- a/tests/Core/DataGrid/DataGridSortByTests.razor +++ b/tests/Core/DataGrid/DataGridSortByTests.razor @@ -1,5 +1,4 @@ @using Bunit -@using FluentAssertions @using Xunit @inherits TestContext diff --git a/tests/Core/DataGrid/FluentDataGridTests.razor b/tests/Core/DataGrid/FluentDataGridTests.razor index 849667fe06..016ffba33f 100644 --- a/tests/Core/DataGrid/FluentDataGridTests.razor +++ b/tests/Core/DataGrid/FluentDataGridTests.razor @@ -1,5 +1,4 @@ -@using FluentAssertions -@using Xunit +@using Xunit @inherits TestContext @code { @@ -43,14 +42,14 @@ ); // Assert - cut.Find("#loading-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#loading-content")); Assert.Throws(() => cut.Find("#empty-content")); cut.SetParametersAndRender(parameters => parameters .Add(p => p.Loading, false)); Assert.Throws(() => cut.Find("#loading-content")); - cut.Find("#empty-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#empty-content")); } [Fact] @@ -76,17 +75,17 @@ // Assert var dataGrid = cut.Instance; - cut.Find("#loading-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#loading-content")); // should stay loading even after data refresh await cut.InvokeAsync(() => dataGrid.RefreshDataAsync()); - cut.Find("#loading-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#loading-content")); // now not loading but still with 0 items, should render empty content cut.SetParametersAndRender(parameters => parameters .Add(p => p.Loading, false)); - cut.Find("#empty-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#empty-content")); } [Fact] @@ -117,7 +116,7 @@ var dataGrid = cut.Instance; // Data is still loading, so loading content should be displayed - cut.Find("#loading-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#loading-content")); tcs.SetResult(); @@ -136,7 +135,7 @@ tcs = new TaskCompletionSource(); cut.SetParametersAndRender(parameters => parameters .Add(p => p.Loading, null)); - cut.Find("#loading-content").Should().NotBeNull(); + Assert.NotNull(cut.Find("#loading-content")); tcs.SetResult(); diff --git a/tests/Core/DataGrid/GridSortTests.cs b/tests/Core/DataGrid/GridSortTests.cs index e71d7f0a99..5bacbc3212 100644 --- a/tests/Core/DataGrid/GridSortTests.cs +++ b/tests/Core/DataGrid/GridSortTests.cs @@ -1,4 +1,4 @@ -using FluentAssertions; + using Xunit; namespace Microsoft.FluentUI.AspNetCore.Components.Tests.DataGrid; @@ -22,9 +22,7 @@ public void GridSortTests_SortBy_Number(bool ascending, IList expected) var sort = GridSort.ByAscending(x => x.Number); var ordered = sort.Apply(_gridData.AsQueryable(), ascending); - ordered.Select(x => x.Number) - .SequenceEqual(expected) - .Should().BeTrue(); + Assert.True(ordered.Select(x => x.Number).SequenceEqual(expected)); } [Theory] @@ -38,9 +36,7 @@ public void GridSortTests_SortBy_GroupThenNumberAscending(bool ascending, IList< var ordered = sort.Apply(_gridData.AsQueryable(), ascending); - ordered.Select(x => x.Number) - .SequenceEqual(expected) - .Should().BeTrue(); + Assert.True(ordered.Select(x => x.Number).SequenceEqual(expected)); } [Theory] @@ -54,9 +50,7 @@ public void GridSortTests_SortBy_GroupThenNumberDescending(bool ascending, IList var ordered = sort.Apply(_gridData.AsQueryable(), ascending); - ordered.Select(x => x.Number) - .SequenceEqual(expected) - .Should().BeTrue(); + Assert.True(ordered.Select(x => x.Number).SequenceEqual(expected)); } [Theory] @@ -70,9 +64,7 @@ public void GridSortTests_SortBy_GroupThenNumberAlwaysAscending(bool ascending, var ordered = sort.Apply(_gridData.AsQueryable(), ascending); - ordered.Select(x => x.Number) - .SequenceEqual(expected) - .Should().BeTrue(); + Assert.True(ordered.Select(x => x.Number).SequenceEqual(expected)); } [Theory] @@ -86,9 +78,7 @@ public void GridSortTests_SortBy_GroupThenNumberAlwaysDescending(bool ascending, var ordered = sort.Apply(_gridData.AsQueryable(), ascending); - ordered.Select(x => x.Number) - .SequenceEqual(expected) - .Should().BeTrue(); + Assert.True(ordered.Select(x => x.Number).SequenceEqual(expected)); } #pragma warning restore CA1861 // Avoid constant arrays as arguments diff --git a/tests/Core/FluentAssert.cs b/tests/Core/FluentAssert.cs index 61cc6d90ea..a17b38e87c 100644 --- a/tests/Core/FluentAssert.cs +++ b/tests/Core/FluentAssert.cs @@ -3,7 +3,7 @@ using AngleSharp.Dom; using Bunit; using Bunit.Rendering; -using FluentAssertions; + using Microsoft.Extensions.DependencyInjection; namespace Microsoft.FluentUI.AspNetCore.Components.Tests; diff --git a/tests/Core/List/FluentAutocompleteTests.razor b/tests/Core/List/FluentAutocompleteTests.razor index f0b77b64dd..3eb8d6dfdc 100644 --- a/tests/Core/List/FluentAutocompleteTests.razor +++ b/tests/Core/List/FluentAutocompleteTests.razor @@ -1,5 +1,4 @@ -@using FluentAssertions -@using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions +@using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions @using Xunit; @inherits TestContext @code @@ -260,11 +259,11 @@ var valueAttribute = textField.Attributes["value"]; var currentValueAttribute = textField.Attributes["current-value"]; - valueAttribute.Should().NotBeNull(); - valueAttribute!.Value.Should().Be("Preselected value"); + Assert.NotNull(valueAttribute); + Assert.Equal("Preselected value", valueAttribute!.Value); - currentValueAttribute.Should().NotBeNull(); - currentValueAttribute!.Value.Should().Be("Preselected value"); + Assert.NotNull(currentValueAttribute); + Assert.Equal("Preselected value", currentValueAttribute!.Value); cut.Verify(); } @@ -280,13 +279,13 @@ parameters.Bind(p => p.ValueText, valueText, x => valueText = x); }); - valueText.Should().NotBeNullOrEmpty(); + Assert.False(string.IsNullOrEmpty(valueText)); // Act cut.Find("svg").Click(); // Clear button // Assert - valueText.Should().BeNullOrEmpty(); + Assert.True(string.IsNullOrEmpty(valueText)); cut.Verify(); } @@ -305,7 +304,7 @@ cut.Find("svg").Click(); // Clear button // Assert - cut.Find("fluent-anchored-region").Should().NotBeNull(); + Assert.NotNull(cut.Find("fluent-anchored-region")); cut.Verify(); } @@ -324,7 +323,7 @@ cut.Find("svg").Click(); // Clear button // Assert - cut.FindAll("fluent-anchored-region").Should().BeNullOrEmpty(); + Assert.Empty(cut.FindAll("fluent-anchored-region")); cut.Verify(); } diff --git a/tests/Core/List/FluentListboxTests.razor b/tests/Core/List/FluentListboxTests.razor index 26eea62ba3..f7b17ed648 100644 --- a/tests/Core/List/FluentListboxTests.razor +++ b/tests/Core/List/FluentListboxTests.razor @@ -1,5 +1,4 @@ -@using FluentAssertions -@using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions +@using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions @using Xunit; @inherits TestContext @code diff --git a/tests/Core/List/FluentSelectTests.razor b/tests/Core/List/FluentSelectTests.razor index 867e94bb59..24f7a60ca8 100644 --- a/tests/Core/List/FluentSelectTests.razor +++ b/tests/Core/List/FluentSelectTests.razor @@ -1,5 +1,4 @@ -@using FluentAssertions -@using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions +@using Microsoft.FluentUI.AspNetCore.Components.Tests.Extensions @using Xunit; @inherits TestContext @code diff --git a/tests/Core/Microsoft.FluentUI.AspNetCore.Components.Tests.csproj b/tests/Core/Microsoft.FluentUI.AspNetCore.Components.Tests.csproj index 7892a528bb..d15e4e1fdc 100644 --- a/tests/Core/Microsoft.FluentUI.AspNetCore.Components.Tests.csproj +++ b/tests/Core/Microsoft.FluentUI.AspNetCore.Components.Tests.csproj @@ -11,7 +11,6 @@ - diff --git a/tests/Core/NumberField/FluentNumberFieldTests.cs b/tests/Core/NumberField/FluentNumberFieldTests.cs index 9ebde4ab53..e4800465d2 100644 --- a/tests/Core/NumberField/FluentNumberFieldTests.cs +++ b/tests/Core/NumberField/FluentNumberFieldTests.cs @@ -1,5 +1,5 @@ using Bunit; -using FluentAssertions; + using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; using Xunit; @@ -325,7 +325,7 @@ public void FluentNumberField_Throw_WhenIntMaxIsSmallerThanMin() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Theory] @@ -348,7 +348,7 @@ public void FluentNumberField_Throw_WhenIntMinOrMax_NullOrEmptyOrWhitespace(stri }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -369,7 +369,7 @@ public void FluentNumberField_Throw_WhenLongMaxIsSmallerThanMin() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -390,7 +390,7 @@ public void FluentNumberField_Throw_WhenShortMaxIsSmallerThanMin() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -411,7 +411,7 @@ public void FluentNumberField_Throw_WhenFloatMaxIsSmallerThanMin() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -431,7 +431,7 @@ public void FluentNumberField_Throw_WhenUShortMinIsLargerThanMax() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -451,7 +451,7 @@ public void FluentNumberField_Throw_WhenUIntMinIsLargerThanMax() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -471,7 +471,7 @@ public void FluentNumberField_Throw_WhenULongMinIsLargerThanMax() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -545,7 +545,7 @@ public void FluentNumberField_Throw_WhenDoubleMaxIsSmallerThanMin() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact] @@ -566,7 +566,7 @@ public void FluentNumberField_Throw_WhenDecimalMaxIsSmallerThanMin() }; // Assert - action.Should().Throw(); + Assert.Throws(action); } [Fact]