diff --git a/test/Soenneker.Utils.AutoBogus.Tests/AutoFakerParallelTests.cs b/test/Soenneker.Utils.AutoBogus.Tests/AutoFakerParallelTests.cs index 14dce7f..32de1fa 100644 --- a/test/Soenneker.Utils.AutoBogus.Tests/AutoFakerParallelTests.cs +++ b/test/Soenneker.Utils.AutoBogus.Tests/AutoFakerParallelTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using FluentAssertions; using Soenneker.Utils.AutoBogus.Tests.Dtos.Simple; using Xunit; @@ -26,10 +27,10 @@ public void Generate_with_ParallelExecution() }); // Assert - Assert.Equal(numberOfTasks, results.Count); + results.Count.Should().Be(numberOfTasks); List ids = results.Select(x => x.Id).ToList(); - Assert.Equal(ids.Count, ids.Distinct().Count()); // Ensure IDs are unique + ids.Should().OnlyHaveUniqueItems(); } [Fact] @@ -48,9 +49,9 @@ public async Task Generate_with_ParallelExecutionTasks() TestClassWithSimpleProperties[] results = await Task.WhenAll(tasks); // Assert - Assert.Equal(numberOfTasks, results.Length); + results.Length.Should().Be(numberOfTasks); List ids = results.Select(x => x.Id).ToList(); - Assert.Equal(ids.Count, ids.Distinct().Count()); // Ensure IDs are unique + ids.Should().OnlyHaveUniqueItems(); } } \ No newline at end of file diff --git a/test/Soenneker.Utils.AutoBogus.Tests/Soenneker.Utils.AutoBogus.Tests.csproj b/test/Soenneker.Utils.AutoBogus.Tests/Soenneker.Utils.AutoBogus.Tests.csproj index c9d1df8..2ce1b50 100644 --- a/test/Soenneker.Utils.AutoBogus.Tests/Soenneker.Utils.AutoBogus.Tests.csproj +++ b/test/Soenneker.Utils.AutoBogus.Tests/Soenneker.Utils.AutoBogus.Tests.csproj @@ -18,7 +18,7 @@ - +