diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/BenchmarkDotNetAnalyser.Tests.Integration.csproj b/test/BenchmarkDotNetAnalyser.Tests.Integration/BenchmarkDotNetAnalyser.Tests.Integration.csproj
index 2771fb0..2af3460 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/BenchmarkDotNetAnalyser.Tests.Integration.csproj
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/BenchmarkDotNetAnalyser.Tests.Integration.csproj
@@ -11,7 +11,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkInfoJsonFileProviderTests.cs b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkInfoJsonFileProviderTests.cs
index 9e881ff..8254620 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkInfoJsonFileProviderTests.cs
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkInfoJsonFileProviderTests.cs
@@ -2,7 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using BenchmarkDotNetAnalyser.Benchmarks;
-using FluentAssertions;
+using Shouldly;
using Xunit;
namespace BenchmarkDotNetAnalyser.Tests.Integration.Classes.Benchmarks
@@ -35,7 +35,7 @@ public async Task GetBenchmarkInfosAsync_WriteBenchmarkInfosAsync_Symmetric(stri
var readResult = await p.GetBenchmarkInfosAsync(dir);
var readResultCount = readResult.Sum(r => r.Runs.Sum(x => x.Results.Count));
- benchmarkInfosResultCount.Should().Be(readResultCount);
+ benchmarkInfosResultCount.ShouldBe(readResultCount);
}
}
}
diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
index 76871f2..56189a0 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkParserTests.cs
@@ -5,7 +5,7 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNetAnalyser.Benchmarks;
using BenchmarkDotNetAnalyser.IO;
-using FluentAssertions;
+using Shouldly;
using Xunit;
namespace BenchmarkDotNetAnalyser.Tests.Integration.Classes.Benchmarks
@@ -49,9 +49,9 @@ public async Task GetCreation_ValueParsed(string filePath)
var result = new BenchmarkParser(json).GetCreation();
- result.Should().BeAfter(default);
- result.Year.Should().BeGreaterThan(2020);
- result.Year.Should().BeLessThan(2100);
+ result.ShouldBeGreaterThan(default);
+ result.Year.ShouldBeGreaterThan(2020);
+ result.Year.ShouldBeLessThan(2100);
}
[Theory]
@@ -63,16 +63,24 @@ public async Task GetBenchmarkEnvironment_ValueParsed(string filePath)
var jo = Newtonsoft.Json.Linq.JObject.Parse(json)["HostEnvironmentInfo"];
var result = new BenchmarkParser(json).GetBenchmarkEnvironment();
- result.Should().NotBeNull();
- result.BenchmarkDotNetVersion.Should().Be(jo.GetStringValue("BenchmarkDotNetVersion")).And.NotBeNullOrWhiteSpace();
- result.DotNetCliVersion.Should().Be(jo.Value("DotNetCliVersion")).And.NotBeNullOrWhiteSpace();
- result.DotNetRuntimeVersion.Should().Be(jo.Value("RuntimeVersion")).And.NotBeNullOrWhiteSpace();
- result.OsVersion.Should().Be(jo.Value("OsVersion")).And.NotBeNullOrWhiteSpace();
- result.ProcessorName.Should().Be(jo.Value("ProcessorName")).And.NotBeNullOrWhiteSpace();
-
- result.PhysicalProcessorCount.Should().Be(jo.Value("PhysicalProcessorCount")).And.BeGreaterThan(0);
- result.LogicalCoreCount.Should().Be(jo.Value("LogicalCoreCount")).And.BeGreaterThan(0);
- result.MachineArchitecture.Should().Be(jo.Value("Architecture")).And.NotBeNullOrWhiteSpace();
+ result.ShouldNotBeNull();
+ result.BenchmarkDotNetVersion.ShouldBe(jo.GetStringValue("BenchmarkDotNetVersion"));
+ result.BenchmarkDotNetVersion.ShouldNotBeNullOrWhiteSpace();
+ result.DotNetCliVersion.ShouldBe(jo.Value("DotNetCliVersion"));
+ result.DotNetCliVersion.ShouldNotBeNullOrWhiteSpace();
+ result.DotNetRuntimeVersion.ShouldBe(jo.Value("RuntimeVersion"));
+ result.DotNetRuntimeVersion.ShouldNotBeNullOrWhiteSpace();
+ result.OsVersion.ShouldBe(jo.Value("OsVersion"));
+ result.OsVersion.ShouldNotBeNullOrWhiteSpace();
+ result.ProcessorName.ShouldBe(jo.Value("ProcessorName"));
+ result.ProcessorName.ShouldNotBeNullOrWhiteSpace();
+
+ result.PhysicalProcessorCount.ShouldBe(jo.Value("PhysicalProcessorCount"));
+ result.PhysicalProcessorCount.ShouldBeGreaterThan(0);
+ result.LogicalCoreCount.ShouldBe(jo.Value("LogicalCoreCount"));
+ result.LogicalCoreCount.ShouldBeGreaterThan(0);
+ result.MachineArchitecture.ShouldBe(jo.Value("Architecture"));
+ result.MachineArchitecture.ShouldNotBeNullOrWhiteSpace();
}
[Theory]
@@ -82,22 +90,32 @@ public async Task GetBenchmarkResults_ValuesParsed(string filePath)
var json = await FileReader.ReadAsync(filePath);
var results = new BenchmarkParser(json).GetBenchmarkResults().ToList();
- results.Count.Should().BeGreaterThan(0);
+ results.Count.ShouldBeGreaterThan(0);
foreach (var result in results)
{
- result.FullName.Should().NotBeNullOrWhiteSpace().And.ContainAny(_benchmarkTypeFullNames);
- result.Namespace.Should().NotBeNullOrWhiteSpace().And.ContainAny(_benchmarkTypeNamespaces);
- result.Type.Should().NotBeNullOrWhiteSpace().And.ContainAny(_benchmarkTypeNames);
- result.Method.Should().NotBeNullOrWhiteSpace().And.ContainAny(_benchmarkMethods);
- result.Parameters.Should().NotBeNull();
-
- result.MaxTime.Should().HaveValue().And.BeGreaterOrEqualTo(0M);
- result.MinTime.Should().HaveValue().And.BeGreaterOrEqualTo(0M);
- result.MeanTime.Should().HaveValue().And.BeGreaterOrEqualTo(0M);
- result.MedianTime.Should().HaveValue().And.BeGreaterOrEqualTo(0M);
- result.Q1Time.Should().HaveValue().And.BeGreaterOrEqualTo(0M);
- result.Q3Time.Should().HaveValue().And.BeGreaterOrEqualTo(0M);
+ result.FullName.ShouldNotBeNullOrWhiteSpace();
+ _benchmarkTypeFullNames.Any(x => result.FullName.Contains(x)).ShouldBeTrue();
+ result.Namespace.ShouldNotBeNullOrWhiteSpace();
+ _benchmarkTypeNamespaces.Any(x => result.Namespace.Contains(x)).ShouldBeTrue();
+ result.Type.ShouldNotBeNullOrWhiteSpace();
+ _benchmarkTypeNames.Any(x => result.Type.Contains(x)).ShouldBeTrue();
+ result.Method.ShouldNotBeNullOrWhiteSpace();
+ _benchmarkMethods.Any(x => result.Method.Contains(x)).ShouldBeTrue();
+ result.Parameters.ShouldNotBeNull();
+
+ result.MaxTime.ShouldNotBeNull();
+ result.MaxTime.Value.ShouldBeGreaterThanOrEqualTo(0M);
+ result.MinTime.ShouldNotBeNull();
+ result.MinTime.Value.ShouldBeGreaterThanOrEqualTo(0M);
+ result.MeanTime.ShouldNotBeNull();
+ result.MeanTime.Value.ShouldBeGreaterThanOrEqualTo(0M);
+ result.MedianTime.ShouldNotBeNull();
+ result.MedianTime.Value.ShouldBeGreaterThanOrEqualTo(0M);
+ result.Q1Time.ShouldNotBeNull();
+ result.Q1Time.Value.ShouldBeGreaterThanOrEqualTo(0M);
+ result.Q3Time.ShouldNotBeNull();
+ result.Q3Time.Value.ShouldBeGreaterThanOrEqualTo(0M);
}
}
}
diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkResultJsonFileReaderTests.cs b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkResultJsonFileReaderTests.cs
index 6f79cb0..21428a7 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkResultJsonFileReaderTests.cs
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkResultJsonFileReaderTests.cs
@@ -2,7 +2,7 @@
using System.Linq;
using System.Threading.Tasks;
using BenchmarkDotNetAnalyser.Benchmarks;
-using FluentAssertions;
+using Shouldly;
using Xunit;
namespace BenchmarkDotNetAnalyser.Tests.Integration.Classes.Benchmarks
@@ -19,7 +19,7 @@ public async Task GetBenchmarkResultsAsync_ResultsReturned(string path)
var result = await reader.GetBenchmarkResultsAsync(path);
- result.Count.Should().BeGreaterThan(0);
+ result.Count.ShouldBeGreaterThan(0);
}
}
}
diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkRunInfoJsonFileProviderTests.cs b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkRunInfoJsonFileProviderTests.cs
index ae9a3ba..31b03f8 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkRunInfoJsonFileProviderTests.cs
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/Benchmarks/BenchmarkRunInfoJsonFileProviderTests.cs
@@ -3,7 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using BenchmarkDotNetAnalyser.Benchmarks;
-using FluentAssertions;
+using Shouldly;
using Xunit;
namespace BenchmarkDotNetAnalyser.Tests.Integration.Classes.Benchmarks
@@ -20,10 +20,10 @@ public async Task GetBenchmarkJsonAsync_ResultsParsed(string path)
var result = await provider.GetRunInfoAsync(path);
- result.Should().NotBeNull();
- result.BenchmarkDotNetVersion.Should().NotBeNullOrWhiteSpace();
- result.Creation.Should().NotBe(DateTimeOffset.MinValue);
- result.Results.Count.Should().BeGreaterThan(0);
+ result.ShouldNotBeNull();
+ result.BenchmarkDotNetVersion.ShouldNotBeNullOrWhiteSpace();
+ result.Creation.ShouldNotBe(DateTimeOffset.MinValue);
+ result.Results.Count.ShouldBeGreaterThan(0);
}
}
}
diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/IO/FileFinderTests.cs b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/IO/FileFinderTests.cs
index e781aaa..2256059 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/IO/FileFinderTests.cs
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/Classes/IO/FileFinderTests.cs
@@ -1,6 +1,6 @@
using System.Linq;
using BenchmarkDotNetAnalyser.IO;
-using FluentAssertions;
+using Shouldly;
using Xunit;
namespace BenchmarkDotNetAnalyser.Tests.Integration.Classes.IO
@@ -18,9 +18,9 @@ public void Find_ReturnsFiles()
var expected = IOHelper.GetSourceResultFilePaths().ToList();
- result.Count.Should().BeGreaterThan(0);
- result.SequenceEqual(expected).Should().BeTrue();
- result.All(x => x.EndsWith(ext)).Should().BeTrue();
+ result.Count.ShouldBeGreaterThan(0);
+ result.SequenceEqual(expected).ShouldBeTrue();
+ result.All(x => x.EndsWith(ext)).ShouldBeTrue();
}
}
}
diff --git a/test/BenchmarkDotNetAnalyser.Tests.Integration/E2E/BaseStory.cs b/test/BenchmarkDotNetAnalyser.Tests.Integration/E2E/BaseStory.cs
index 576380e..a830f06 100644
--- a/test/BenchmarkDotNetAnalyser.Tests.Integration/E2E/BaseStory.cs
+++ b/test/BenchmarkDotNetAnalyser.Tests.Integration/E2E/BaseStory.cs
@@ -11,8 +11,8 @@
using BenchmarkDotNetAnalyser.Instrumentation;
using BenchmarkDotNetAnalyser.IO;
using BenchmarkDotNetAnalyser.Reporting;
-using FluentAssertions;
-using FluentAssertions.Execution;
+using Shouldly;
+
using Newtonsoft.Json;
using NSubstitute;
@@ -89,7 +89,7 @@ public async Task AggregationExecutorExecuted(bool expectedResult = true)
_aggregateResult = await aggregator.ExecuteAsync(_aggregateArgs);
- _aggregateResult.Should().Be(expectedResult);
+ _aggregateResult.ShouldBe(expectedResult);
}
public async Task AggregatedBenchmarkInfosFetched()
@@ -101,34 +101,34 @@ public async Task AggregatedBenchmarkInfosFetched()
public void SingletonBenchmarkInfoIsChecked()
{
- _newBenchmarkInfos.Count.Should().Be(1);
+ _newBenchmarkInfos.Count.ShouldBe(1);
- _newBenchmarkInfos[0].BranchName.Should().Be(_aggregateArgs.BranchName);
- _newBenchmarkInfos[0].CommitSha.Should().Be(_aggregateArgs.CommitSha);
- _newBenchmarkInfos[0].BuildUri.Should().Be(_aggregateArgs.BuildUri);
- _newBenchmarkInfos[0].Tags.Should().BeEquivalentTo(_aggregateArgs.Tags);
+ _newBenchmarkInfos[0].BranchName.ShouldBe(_aggregateArgs.BranchName);
+ _newBenchmarkInfos[0].CommitSha.ShouldBe(_aggregateArgs.CommitSha);
+ _newBenchmarkInfos[0].BuildUri.ShouldBe(_aggregateArgs.BuildUri);
+ _newBenchmarkInfos[0].Tags.ShouldBe(_aggregateArgs.Tags);
- _newBenchmarkInfos[0].Runs.Should().HaveCount(_newRunFiles);
+ _newBenchmarkInfos[0].Runs.Count.ShouldBe(_newRunFiles);
- _newBenchmarkInfos[0].Runs.All(p => !string.IsNullOrWhiteSpace(p.BenchmarkDotNetVersion)).Should().BeTrue();
- _newBenchmarkInfos[0].Runs.All(p => p.Creation > DateTimeOffset.MinValue).Should().BeTrue();
+ _newBenchmarkInfos[0].Runs.All(p => !string.IsNullOrWhiteSpace(p.BenchmarkDotNetVersion)).ShouldBeTrue();
+ _newBenchmarkInfos[0].Runs.All(p => p.Creation > DateTimeOffset.MinValue).ShouldBeTrue();
}
public void MultipleBenchmarkInfosAreChecked()
{
- _newBenchmarkInfos.Count.Should().Be(_aggregateArgs.BenchmarkRuns);
+ _newBenchmarkInfos.Count.ShouldBe(_aggregateArgs.BenchmarkRuns);
foreach (var bi in _newBenchmarkInfos)
{
- bi.BranchName.Should().Be(_aggregateArgs.BranchName);
- bi.CommitSha.Should().Be(_aggregateArgs.CommitSha);
- bi.BuildUri.Should().Be(_aggregateArgs.BuildUri);
- bi.Tags.Should().BeEquivalentTo(_aggregateArgs.Tags);
+ bi.BranchName.ShouldBe(_aggregateArgs.BranchName);
+ bi.CommitSha.ShouldBe(_aggregateArgs.CommitSha);
+ bi.BuildUri.ShouldBe(_aggregateArgs.BuildUri);
+ bi.Tags.ShouldBe(_aggregateArgs.Tags);
- bi.Runs.Should().HaveCount(_newRunFiles);
+ bi.Runs.Count.ShouldBe(_newRunFiles);
- bi.Runs.All(p => !string.IsNullOrWhiteSpace(p.BenchmarkDotNetVersion)).Should().BeTrue();
- bi.Runs.All(p => p.Creation > DateTimeOffset.MinValue).Should().BeTrue();
+ bi.Runs.All(p => !string.IsNullOrWhiteSpace(p.BenchmarkDotNetVersion)).ShouldBeTrue();
+ bi.Runs.All(p => p.Creation > DateTimeOffset.MinValue).ShouldBeTrue();
}
}
@@ -141,7 +141,7 @@ public void BenchmarkRunResultsRetrieved()
public void EmptyBenchmarkRunResultsChecked()
{
- _benchmarkRunResults.Count.Should().Be(0);
+ _benchmarkRunResults.Count.ShouldBe(0);
}
public void BenchmarkRunResultsChecked()
@@ -150,12 +150,12 @@ public void BenchmarkRunResultsChecked()
foreach (var br in results)
{
- br.FullName.Should().NotBeNullOrWhiteSpace();
- br.Method.Should().NotBeNullOrWhiteSpace();
- br.Namespace.Should().NotBeNullOrWhiteSpace();
+ br.FullName.ShouldNotBeNullOrWhiteSpace();
+ br.Method.ShouldNotBeNullOrWhiteSpace();
+ br.Namespace.ShouldNotBeNullOrWhiteSpace();
}
- _benchmarkRunResults.All(brr => brr.Results.Count > 0).Should().BeTrue();
- _benchmarkRunResults.All(brr => brr.Run != null).Should().BeTrue();
+ _benchmarkRunResults.All(brr => brr.Results.Count > 0).ShouldBeTrue();
+ _benchmarkRunResults.All(brr => brr.Run != null).ShouldBeTrue();
}
public void AnalysisArgsCreated(decimal tolerance, int maxErrors)
@@ -175,20 +175,20 @@ public async Task AnalysisExecutorExecuted()
_analysisResult = await analyser.ExecuteAsync(_analysisArgs);
- _analysisResult.Should().NotBeNull();
+ _analysisResult.ShouldNotBeNull();
}
public void AnalysisResultCheckedForSuccess()
{
- _analysisResult.MeetsRequirements.Should().BeTrue();
- _analysisResult.InnerResults.Any(bra => bra.MeetsRequirements).Should().BeTrue();
- _analysisResult.InnerResults.Count.Should().BeGreaterThan(0);
+ _analysisResult.MeetsRequirements.ShouldBeTrue();
+ _analysisResult.InnerResults.Any(bra => bra.MeetsRequirements).ShouldBeTrue();
+ _analysisResult.InnerResults.Count.ShouldBeGreaterThan(0);
}
public void AnalysisResultCheckedForFailure()
{
- _analysisResult.MeetsRequirements.Should().BeFalse();
- _analysisResult.Message.Should().NotBeNullOrWhiteSpace();
+ _analysisResult.MeetsRequirements.ShouldBeFalse();
+ _analysisResult.Message.ShouldNotBeNullOrWhiteSpace();
}
public void ReportsDirectoryCreated()
@@ -221,7 +221,7 @@ public void CsvReportsAreVerified()
{
if (!File.Exists(file))
{
- throw new AssertionFailedException($"File {file} does not exist.");
+ throw new Exception($"File {file} does not exist.");
}
using (var stream = File.OpenText(file))
@@ -230,7 +230,7 @@ public void CsvReportsAreVerified()
{
var recs = csvReader.GetRecords