diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 29277b1a4..a7ff0118d 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -23,9 +23,9 @@ updates:
fallout:
patterns:
- "Fallout*"
- xunit:
+ tunit:
patterns:
- - "xunit*"
+ - "TUnit*"
aweXpect:
patterns:
- "aweXpect*"
diff --git a/AGENTS.md b/AGENTS.md
index 4de2825d8..a4bd44eea 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -4,8 +4,8 @@ Mockolate is a source-generated mocking library for .NET. Users write `IFoo.Crea
## SDK and Build
-- Use the SDK pinned in `global.json` (.NET 10, `rollForward: latestMinor`). Tests also run on .NET 8, and on .NET Framework 4.8 on Windows only.
-- Build from the root with `dotnet build Mockolate.slnx`. Shared settings live in the root `Directory.Build.props` (strong naming, `MinimumRoslynVersion`), `Source/Directory.Build.props` (target frameworks, warnings as errors, AOT and trimming flags) and `Tests/Directory.Build.props` (test frameworks, xUnit, aweXpect).
+- Use the SDK pinned in `global.json` (.NET 10, `rollForward: latestPatch`). Tests also run on .NET 8, and on .NET Framework 4.8 on Windows only.
+- Build from the root with `dotnet build Mockolate.slnx`. Shared settings live in the root `Directory.Build.props` (strong naming, `MinimumRoslynVersion`), `Source/Directory.Build.props` (target frameworks, warnings as errors, AOT and trimming flags) and `Tests/Directory.Build.props` (test frameworks, TUnit, aweXpect).
- Package versions belong only in `Directory.Packages.props`. `VersionOverride` is used only to pin Roslyn packages to `$(MinimumRoslynVersion)`.
## Design Goals
@@ -22,7 +22,7 @@ Correctness is a must. The other goals are strong defaults and win in this order
- **Performance**: recording, setup matching and verification are hot paths with allocation-free fast paths (`FastMockInteractions`, the `Fast*Buffer` types). Measure hot-path changes with the benchmarks before and after.
- **Public API**: every change to the public surface of `Mockolate` shows up in the API snapshots. Document new public members with XML comments. Mark breaking changes with `!` in the PR title (`feat!:`, `refactor!:`).
- **Strong naming**: all assemblies are signed with `strongname.snk`; an `InternalsVisibleTo` needs `PublicKey="$(PublicKey)"`.
-- **Style**: follow `.editorconfig`: tabs, explicit types instead of `var`, `_camelCase` private fields, no `this.`, `System` usings first. Tests use xUnit with aweXpect (`await That(...)`).
+- **Style**: follow `.editorconfig`: tabs, explicit types instead of `var`, `_camelCase` private fields, no `this.`, `System` usings first. Tests use TUnit with aweXpect (`await That(...)`).
## Validation
diff --git a/Directory.Packages.props b/Directory.Packages.props
index c141a6fae..c968bf725 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -28,12 +28,10 @@
-
-
-
-
-
+
+
+
diff --git a/Docs/agents/workflows.md b/Docs/agents/workflows.md
index 3c8da5c91..ce0782bbe 100644
--- a/Docs/agents/workflows.md
+++ b/Docs/agents/workflows.md
@@ -12,15 +12,20 @@ The test projects reference the generator as an analyzer through a project refer
## Test
+The tests use TUnit on the Microsoft.Testing.Platform, which `global.json` selects as the runner of `dotnet test`. Each test project is an executable, so `dotnet run` works as well. The explicit tests (the snapshot acceptance tests) run only when the filter selects nothing but explicit tests.
+
```powershell
# One project, all of its target frameworks
-dotnet test Tests/Mockolate.Tests
+dotnet test --project Tests/Mockolate.Tests
+
+# One framework and a tree node filter (/assembly/namespace/class/test, nested classes match with a wildcard)
+dotnet test --project Tests/Mockolate.Tests -f net10.0 --treenode-filter "/*/*/*IsTrueTests/*"
-# One framework and a name filter (VSTest filter syntax)
-dotnet test Tests/Mockolate.Tests -f net10.0 --filter "FullyQualifiedName~IsTrueTests"
+# The same without dotnet test
+dotnet run --project Tests/Mockolate.Tests -f net10.0 -- --treenode-filter "/*/*/*IsTrueTests/*"
# Everything in the solution
-dotnet test Mockolate.slnx
+dotnet test --solution Mockolate.slnx
```
Target frameworks per test project:
@@ -52,7 +57,7 @@ A newer language feature can compile for `net10.0` and fail for `net48`; build o
After an intended change, overwrite the expected files with the explicit acceptance test and review the diff:
```powershell
-dotnet test Tests/Mockolate.SourceGenerators.Tests --filter "FullyQualifiedName~AcceptSnapshotChanges" -- xUnit.Explicit=only
+dotnet test --project Tests/Mockolate.SourceGenerators.Tests --treenode-filter "/*/*/*/AcceptSnapshotChanges"
git diff -- Tests/Mockolate.SourceGenerators.Tests/Snapshot
```
@@ -67,7 +72,7 @@ To add a scenario, add an entry to `Scenarios` and run the acceptance test.
- run the tests with `AWEXPECT_ACCEPT_SNAPSHOTS=all`.
```powershell
-dotnet test Tests/Mockolate.Api.Tests --filter "FullyQualifiedName~AcceptApiChanges" -- xUnit.Explicit=only
+dotnet test --project Tests/Mockolate.Api.Tests --treenode-filter "/*/*/*/AcceptApiChanges"
```
Commit the updated snapshots with the change; never commit pending files.
@@ -96,13 +101,13 @@ CI runs one job per class: `CallbackBenchmarks`, `CompleteEventBenchmarks`, `Com
## Mutation Tests
-Stryker mutates `Source/Mockolate` against `Mockolate.Tests` and `Mockolate.Internal.Tests` on `net8.0` with mutation level `Advanced`. Outside `main` it only mutates code changed since `main`. A full run takes long; run it only when asked:
+Stryker mutates `Source/Mockolate` against `Mockolate.Tests` and `Mockolate.Internal.Tests` on `net8.0` with mutation level `Advanced`, through its runner for the Microsoft.Testing.Platform (`--test-runner mtp`). The version is the `dotnet-stryker` `PackageDownload` in `Pipeline/Build.csproj`. Outside `main` it only mutates code changed since `main`. A full run takes long; run it only when asked:
```powershell
-./build.ps1 MutationTestExecution
+./build.ps1 MutationTests
```
-Reports go to `Artifacts/Stryker`. The `MutationTests` target also prepares the PR comment and expects to run in GitHub Actions.
+Reports go to `Artifacts/Stryker`, together with the Markdown body of the PR comment. `MutationTestsComment` and `MutationTestsDashboard` post the comment and upload the report, and expect to run in GitHub Actions.
## Build Pipeline (Fallout)
@@ -111,14 +116,14 @@ Reports go to `Artifacts/Stryker`. The `MutationTests` target also prepares the
| Target | Purpose |
|---|---|
| `Compile` | Restore and build the solution with the GitVersion-derived version |
-| `UnitTests` | Run `Build.Tests`, `Mockolate.Tests`, `Mockolate.Internal.Tests`, `Mockolate.Analyzers.Tests` and `Mockolate.SourceGenerators.Tests` for each framework (`net48` only on Windows) with coverage |
-| `CodeCoverage` | `UnitTests` plus a ReportGenerator OpenCover report in `TestResults/reports` |
+| `UnitTests` | Run `Build.Tests`, `Mockolate.Tests`, `Mockolate.Internal.Tests`, `Mockolate.Analyzers.Tests` and `Mockolate.SourceGenerators.Tests` for each framework (`net48` only on Windows), with a TRX and a Cobertura coverage file per project and framework in `TestResults` |
+| `CodeCoverage` | `UnitTests` plus a ReportGenerator SonarQube report in `TestResults/reports` |
| `ApiChecks` | Run `Mockolate.Api.Tests` |
| `CodeAnalysis` | SonarCloud analysis (needs `SonarToken`) |
| `Pack` | Build the NuGet package into `Artifacts/Packages`, with a release-specific README |
| `Benchmarks` | Run the benchmarks (`--benchmark-filter`, default `*`) and print the reports |
| `BenchmarkComment`, `PublishBenchmarkReport` | CI only: PR comment and docs site data |
-| `MutationTests`, `MutationTestExecution`, `MutationTestComment`, `MutationTestDashboard` | Stryker run, PR comment and dashboard upload |
+| `MutationTests`, `MutationTestsComment`, `MutationTestsDashboard` | Stryker run, PR comment and dashboard upload |
| `UpdateReadme` | Write the packaged README to `Artifacts/README.md` |
## CI Workflows
diff --git a/Pipeline/Build.ApiChecks.cs b/Pipeline/Build.ApiChecks.cs
index fee643576..4f6e03e7f 100644
--- a/Pipeline/Build.ApiChecks.cs
+++ b/Pipeline/Build.ApiChecks.cs
@@ -21,8 +21,9 @@ partial class Build
.SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
.EnableNoBuild()
.SetResultsDirectory(TestResultsDirectory)
- .CombineWith(cc => cc
- .SetProjectFile(project)
- .AddLoggers($"trx;LogFileName={project.Name}.trx")), completeOnFailure: true);
+ .AddProcessAdditionalArguments(
+ $"--project \"{project.Path}\"",
+ "--report-trx",
+ $"--report-trx-filename {project.Name}.trx"));
});
}
diff --git a/Pipeline/Build.CodeCoverage.cs b/Pipeline/Build.CodeCoverage.cs
index 0efea9625..166722774 100644
--- a/Pipeline/Build.CodeCoverage.cs
+++ b/Pipeline/Build.CodeCoverage.cs
@@ -17,7 +17,7 @@ partial class Build
.SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll",
framework: "net10.0"))
.SetTargetDirectory(TestResultsDirectory / "reports")
- .AddReports(TestResultsDirectory / "**/coverage.cobertura.xml")
+ .AddReports(TestResultsDirectory / "**/*.cobertura.xml")
// The generic format of Sonar lists the lines per file. A format that lists them per method leaves out the
// lines of a lambda in a generic class, because ReportGenerator keeps them in a class without methods.
.AddReportTypes(ReportTypes.SonarQube)
diff --git a/Pipeline/Build.MutationTests.cs b/Pipeline/Build.MutationTests.cs
index f25b76139..35a250c61 100644
--- a/Pipeline/Build.MutationTests.cs
+++ b/Pipeline/Build.MutationTests.cs
@@ -92,8 +92,9 @@ partial class Build
File.WriteAllText(configFile, configText);
Log.Debug($"Created '{configFile}':{Environment.NewLine}{configText}");
+ // The unit tests are executables of the Microsoft.Testing.Platform, which the default runner (VSTest) cannot run.
string arguments =
- $"-f \"{configFile}\" -O \"{strykerOutputDirectory}\" -r \"Markdown\" -r \"cleartext\" -r \"json\"";
+ $"-f \"{configFile}\" -O \"{strykerOutputDirectory}\" -r \"Markdown\" -r \"cleartext\" -r \"json\" --test-runner mtp";
string executable = EnvironmentInfo.IsWin ? "dotnet-stryker.exe" : "dotnet-stryker";
IProcess process = ProcessTasks.StartProcess(
diff --git a/Pipeline/Build.UnitTest.cs b/Pipeline/Build.UnitTest.cs
index 6b1533e9e..f5ea539e1 100644
--- a/Pipeline/Build.UnitTest.cs
+++ b/Pipeline/Build.UnitTest.cs
@@ -36,17 +36,21 @@ partial class Build
.SetConfiguration(Configuration)
.SetProcessEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en-US")
.EnableNoBuild()
- .SetDataCollector("XPlat Code Coverage")
.SetResultsDirectory(TestResultsDirectory)
.CombineWith(
UnitTestProjects,
(settings, project) => settings
- .SetProjectFile(project)
.CombineWith(
project.GetTargetFrameworks()?.Except(excludedFrameworks),
(frameworkSettings, framework) => frameworkSettings
.SetFramework(framework)
- .AddLoggers($"trx;LogFileName={project.Name}_{framework}.trx")
+ .AddProcessAdditionalArguments(
+ $"--project \"{project.Path}\"",
+ "--report-trx",
+ $"--report-trx-filename {project.Name}_{framework}.trx",
+ "--coverage",
+ "--coverage-output-format cobertura",
+ $"--coverage-output {project.Name}_{framework}.cobertura.xml")
)
), completeOnFailure: true
);
diff --git a/Pipeline/Build.csproj b/Pipeline/Build.csproj
index 524718798..f0496e9e9 100644
--- a/Pipeline/Build.csproj
+++ b/Pipeline/Build.csproj
@@ -27,12 +27,10 @@
-
-
diff --git a/Tests/Build.Tests/BenchmarkReportHelpersTests.cs b/Tests/Build.Tests/BenchmarkReportHelpersTests.cs
index 99a711506..e7a7f4ca4 100644
--- a/Tests/Build.Tests/BenchmarkReportHelpersTests.cs
+++ b/Tests/Build.Tests/BenchmarkReportHelpersTests.cs
@@ -2,7 +2,7 @@ namespace Build.Tests;
public sealed class BenchmarkReportHelpersTests
{
- [Fact]
+ [Test]
public async Task ApplyHeaderAndPrefixStripping_ShouldRemoveCommonPrefixFromDataRow()
{
TableRow row = new(BenchmarkTableParser.DataRowStartIndex, ["PropRead_Mockolate", "1",]);
@@ -12,7 +12,7 @@ public async Task ApplyHeaderAndPrefixStripping_ShouldRemoveCommonPrefixFromData
await That(result).IsEqualTo(["Mockolate", "1",]);
}
- [Fact]
+ [Test]
public async Task ApplyHeaderAndPrefixStripping_ShouldStripTrailingUnderscoreFromHeader()
{
TableRow header = new(0, ["Method", "Mean",]);
@@ -22,7 +22,7 @@ public async Task ApplyHeaderAndPrefixStripping_ShouldStripTrailingUnderscoreFro
await That(result).IsEqualTo(["PropRead", "Mean",]);
}
- [Fact]
+ [Test]
public async Task ApplyHeaderAndPrefixStripping_WhenCommonPrefixIsNull_ShouldReturnTokensUnchanged()
{
TableRow row = new(BenchmarkTableParser.DataRowStartIndex, ["Foo", "1",]);
@@ -32,7 +32,7 @@ public async Task ApplyHeaderAndPrefixStripping_WhenCommonPrefixIsNull_ShouldRet
await That(result).IsEqualTo(["Foo", "1",]);
}
- [Fact]
+ [Test]
public async Task DetermineDroppedColumnIndices_ShouldMatchCaseInsensitivelyAndReturnIndicesInHeaderOrder()
{
int[] indices = BenchmarkReport.DetermineDroppedColumnIndices(
@@ -42,7 +42,7 @@ public async Task DetermineDroppedColumnIndices_ShouldMatchCaseInsensitivelyAndR
await That(indices).IsEqualTo([2, 3,]);
}
- [Fact]
+ [Test]
public async Task DetermineDroppedColumnIndices_WhenNoColumnsMatch_ShouldReturnEmpty()
{
int[] indices = BenchmarkReport.DetermineDroppedColumnIndices(
@@ -52,7 +52,7 @@ public async Task DetermineDroppedColumnIndices_WhenNoColumnsMatch_ShouldReturnE
await That(indices).IsEqualTo(Array.Empty());
}
- [Fact]
+ [Test]
public async Task FindColumnIndex_ShouldMatchCaseInsensitively()
{
int index = BenchmarkReport.FindColumnIndex(["Method", "Mean", "Alloc Ratio",], "alloc ratio");
@@ -60,7 +60,7 @@ public async Task FindColumnIndex_ShouldMatchCaseInsensitively()
await That(index).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task FindColumnIndex_WhenColumnNotFound_ShouldReturnMinusOne()
{
int index = BenchmarkReport.FindColumnIndex(["Method", "Mean",], "Ratio");
@@ -68,7 +68,7 @@ public async Task FindColumnIndex_WhenColumnNotFound_ShouldReturnMinusOne()
await That(index).IsEqualTo(-1);
}
- [Fact]
+ [Test]
public async Task FindCommonRowPrefix_ShouldIgnoreHeaderAndSeparatorRows()
{
List rows =
@@ -82,7 +82,7 @@ public async Task FindCommonRowPrefix_ShouldIgnoreHeaderAndSeparatorRows()
await That(prefix).IsNull();
}
- [Fact]
+ [Test]
public async Task FindCommonRowPrefix_ShouldSkipBaselineMarkerRow()
{
List rows =
@@ -97,7 +97,7 @@ public async Task FindCommonRowPrefix_ShouldSkipBaselineMarkerRow()
await That(prefix).IsEqualTo("Indexer_");
}
- [Fact]
+ [Test]
public async Task FindCommonRowPrefix_ShouldSkipEmptyDataRowAndUseRemainingRows()
{
List rows =
@@ -114,7 +114,7 @@ public async Task FindCommonRowPrefix_ShouldSkipEmptyDataRowAndUseRemainingRows(
await That(prefix).IsEqualTo("Indexer_");
}
- [Fact]
+ [Test]
public async Task FindCommonRowPrefix_WhenADataRowHasNoUnderscore_ShouldReturnNull()
{
List rows =
@@ -127,7 +127,7 @@ public async Task FindCommonRowPrefix_WhenADataRowHasNoUnderscore_ShouldReturnNu
await That(prefix).IsNull();
}
- [Fact]
+ [Test]
public async Task FindCommonRowPrefix_WhenAllDataRowsShareAPrefix_ShouldReturnPrefixWithTrailingUnderscore()
{
List rows =
@@ -143,7 +143,7 @@ public async Task FindCommonRowPrefix_WhenAllDataRowsShareAPrefix_ShouldReturnPr
await That(prefix).IsEqualTo("PropRead_");
}
- [Fact]
+ [Test]
public async Task FindCommonRowPrefix_WhenDataRowsDisagree_ShouldReturnNull()
{
List rows =
@@ -157,7 +157,7 @@ public async Task FindCommonRowPrefix_WhenDataRowsDisagree_ShouldReturnNull()
await That(prefix).IsNull();
}
- [Fact]
+ [Test]
public async Task RecomputeBaselineRatio_ShouldOverwriteRatioWithBaselineDividedByMockolate()
{
string[] baseline = ["Foo_Mockolate", "206.44 ns", "1.00", "1048 B", "1.00",];
@@ -168,7 +168,7 @@ public async Task RecomputeBaselineRatio_ShouldOverwriteRatioWithBaselineDivided
await That(baseline[2]).IsEqualTo("0.95");
}
- [Fact]
+ [Test]
public async Task RecomputeBaselineRatio_WhenRatioIndexIsMissing_ShouldNotMutate()
{
string[] baseline = ["Foo_Mockolate", "206.44 ns",];
@@ -179,7 +179,7 @@ public async Task RecomputeBaselineRatio_WhenRatioIndexIsMissing_ShouldNotMutate
await That(baseline).IsEqualTo(["Foo_Mockolate", "206.44 ns",]);
}
- [Fact]
+ [Test]
public async Task RecomputeBaselineRatio_WhenValueCannotBeParsed_ShouldNotMutate()
{
string[] baseline = ["Foo_Mockolate", "junk", "1.00",];
@@ -190,7 +190,7 @@ public async Task RecomputeBaselineRatio_WhenValueCannotBeParsed_ShouldNotMutate
await That(baseline[2]).IsEqualTo("1.00");
}
- [Fact]
+ [Test]
public async Task RemoveColumns_ShouldDropTheGivenIndicesAndPreserveTheRest()
{
string result = BenchmarkReport.RemoveColumns(
@@ -200,7 +200,7 @@ public async Task RemoveColumns_ShouldDropTheGivenIndicesAndPreserveTheRest()
await That(result).IsEqualTo("| Method | Mean | Allocated |");
}
- [Fact]
+ [Test]
public async Task RemoveColumns_WhenIndicesAreEmpty_ShouldReturnLineUnchanged()
{
string original = "| Method | Mean |";
@@ -210,7 +210,7 @@ public async Task RemoveColumns_WhenIndicesAreEmpty_ShouldReturnLineUnchanged()
await That(result).IsEqualTo(original);
}
- [Fact]
+ [Test]
public async Task SplitTableRow_ShouldReturnTrimmedInteriorCells()
{
string[] tokens = BenchmarkReport.SplitTableRow("| Foo | bar baz | 42 |");
@@ -218,7 +218,7 @@ public async Task SplitTableRow_ShouldReturnTrimmedInteriorCells()
await That(tokens).IsEqualTo(["Foo", "bar baz", "42",]);
}
- [Fact]
+ [Test]
public async Task SplitTableRow_WhenLineHasNoPipe_ShouldReturnEmptyArray()
{
string[] tokens = BenchmarkReport.SplitTableRow("hello world");
@@ -226,11 +226,11 @@ public async Task SplitTableRow_WhenLineHasNoPipe_ShouldReturnEmptyArray()
await That(tokens).IsEqualTo(Array.Empty());
}
- [Theory]
- [InlineData("1048 B", 1048.0)]
- [InlineData("1 KB", 1024.0)]
- [InlineData("2 MB", 2.0 * 1024 * 1024)]
- [InlineData("3 GB", 3.0 * 1024 * 1024 * 1024)]
+ [Test]
+ [Arguments("1048 B", 1048.0)]
+ [Arguments("1 KB", 1024.0)]
+ [Arguments("2 MB", 2.0 * 1024 * 1024)]
+ [Arguments("3 GB", 3.0 * 1024 * 1024 * 1024)]
public async Task TryParseQuantity_ShouldNormalizeMemoryUnitsToBytes(string value, double expected)
{
bool ok = BenchmarkReport.TryParseQuantity(value, out double actual);
@@ -239,14 +239,14 @@ public async Task TryParseQuantity_ShouldNormalizeMemoryUnitsToBytes(string valu
await That(actual).IsEqualTo(expected).Within(0.0001);
}
- [Theory]
- [InlineData("206.44 ns", 206.44)]
- [InlineData("1,377.70 ns", 1377.70)]
- [InlineData("1.00 μs", 1000.0)]
- [InlineData("1.00 us", 1000.0)]
- [InlineData("2 ms", 2_000_000.0)]
- [InlineData("3 s", 3_000_000_000.0)]
- [InlineData("500 ps", 0.5)]
+ [Test]
+ [Arguments("206.44 ns", 206.44)]
+ [Arguments("1,377.70 ns", 1377.70)]
+ [Arguments("1.00 μs", 1000.0)]
+ [Arguments("1.00 us", 1000.0)]
+ [Arguments("2 ms", 2_000_000.0)]
+ [Arguments("3 s", 3_000_000_000.0)]
+ [Arguments("500 ps", 0.5)]
public async Task TryParseQuantity_ShouldNormalizeTimeUnitsToNanoseconds(string value, double expected)
{
bool ok = BenchmarkReport.TryParseQuantity(value, out double actual);
@@ -255,10 +255,10 @@ public async Task TryParseQuantity_ShouldNormalizeTimeUnitsToNanoseconds(string
await That(actual).IsEqualTo(expected).Within(0.0001);
}
- [Theory]
- [InlineData("")]
- [InlineData("not a number")]
- [InlineData("100 weird")]
+ [Test]
+ [Arguments("")]
+ [Arguments("not a number")]
+ [Arguments("100 weird")]
public async Task TryParseQuantity_WhenInputIsInvalid_ShouldReturnFalse(string value)
{
bool ok = BenchmarkReport.TryParseQuantity(value, out _);
diff --git a/Tests/Build.Tests/BenchmarkTableParserTests.cs b/Tests/Build.Tests/BenchmarkTableParserTests.cs
index 509049206..9381ea6bf 100644
--- a/Tests/Build.Tests/BenchmarkTableParserTests.cs
+++ b/Tests/Build.Tests/BenchmarkTableParserTests.cs
@@ -2,7 +2,7 @@ namespace Build.Tests;
public sealed class BenchmarkTableParserTests
{
- [Fact]
+ [Test]
public async Task Reset_ShouldClearMeanIndexAndAllowFreshTable()
{
BenchmarkTableParser parser = new([]);
@@ -16,7 +16,7 @@ public async Task Reset_ShouldClearMeanIndexAndAllowFreshTable()
await That(parser.MeanIndex).IsEqualTo(-1);
}
- [Fact]
+ [Test]
public async Task TryConsume_ShouldAssignSequentialRowIndicesStartingAtZero()
{
BenchmarkTableParser parser = new([]);
@@ -32,7 +32,7 @@ public async Task TryConsume_ShouldAssignSequentialRowIndicesStartingAtZero()
await That(secondData).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task TryConsume_ShouldComputeDroppedIndicesOnceAndReuseThemForLaterRows()
{
BenchmarkTableParser parser = new(["Gen0",]);
@@ -43,7 +43,7 @@ public async Task TryConsume_ShouldComputeDroppedIndicesOnceAndReuseThemForLater
await That(filtered).IsEqualTo("| Foo | 1 ns | 100 B |");
}
- [Fact]
+ [Test]
public async Task TryConsume_ShouldDetectMeanColumnFromHeader()
{
BenchmarkTableParser parser = new([]);
@@ -53,7 +53,7 @@ public async Task TryConsume_ShouldDetectMeanColumnFromHeader()
await That(parser.MeanIndex).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task TryConsume_ShouldDropConfiguredColumnsCaseInsensitively()
{
BenchmarkTableParser parser = new(["Gen0", "GEN1",]);
@@ -68,7 +68,7 @@ public async Task TryConsume_ShouldDropConfiguredColumnsCaseInsensitively()
await That(dataTokens).IsEqualTo(["Foo", "1 ns", "100 B",]);
}
- [Fact]
+ [Test]
public async Task TryConsume_ShouldStripBdnBoldMarkdownFromTokens()
{
BenchmarkTableParser parser = new([]);
@@ -80,7 +80,7 @@ public async Task TryConsume_ShouldStripBdnBoldMarkdownFromTokens()
await That(tokens).IsEqualTo(["Indexer_Mockolate", "1", "923 ns",]);
}
- [Fact]
+ [Test]
public async Task TryConsume_WhenHeaderHasNoMeanColumn_ShouldReportNegativeMeanIndex()
{
BenchmarkTableParser parser = new([]);
@@ -90,7 +90,7 @@ public async Task TryConsume_WhenHeaderHasNoMeanColumn_ShouldReportNegativeMeanI
await That(parser.MeanIndex).IsEqualTo(-1);
}
- [Fact]
+ [Test]
public async Task TryConsume_WhenLineIsNotTableShaped_ShouldReturnFalseAndKeepInitialState()
{
BenchmarkTableParser parser = new([]);
@@ -104,7 +104,7 @@ public async Task TryConsume_WhenLineIsNotTableShaped_ShouldReturnFalseAndKeepIn
await That(tokens).IsNull();
}
- [Fact]
+ [Test]
public async Task TryConsume_WhenNonTableLineFollowsTable_ShouldAutoResetSoNextTableStartsAtZero()
{
BenchmarkTableParser parser = new([]);
diff --git a/Tests/Build.Tests/BuildBodyTests.cs b/Tests/Build.Tests/BuildBodyTests.cs
index 183abfff2..e55e6b0e9 100644
--- a/Tests/Build.Tests/BuildBodyTests.cs
+++ b/Tests/Build.Tests/BuildBodyTests.cs
@@ -2,7 +2,7 @@ namespace Build.Tests;
public sealed class BuildBodyTests
{
- [Fact]
+ [Test]
public async Task BuildBody_BaselineKeyShouldUseTokensUpToTheMeanColumn()
{
string[] report =
@@ -24,7 +24,7 @@ public async Task BuildBody_BaselineKeyShouldUseTokensUpToTheMeanColumn()
await That(body).DoesNotContain("baseline*");
}
- [Fact]
+ [Test]
public async Task BuildBody_ShouldDropConfiguredColumnsFromHeaderAndDataRows()
{
string[] withGen2 =
@@ -43,7 +43,7 @@ public async Task BuildBody_ShouldDropConfiguredColumnsFromHeaderAndDataRows()
await That(body).DoesNotContain("0.2");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenBaselineHasNoMatchingKey_ShouldOmitInjectionAndOmitNote()
{
string[] baseline =
@@ -59,7 +59,7 @@ public async Task BuildBody_WhenBaselineHasNoMatchingKey_ShouldOmitInjectionAndO
await That(body).DoesNotContain("baseline*");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenBdnPreBoldsBaselineFile_ShouldEmitItalicBaselineWithoutEmbeddedBold()
{
string[] report =
@@ -83,7 +83,7 @@ public async Task BuildBody_WhenBdnPreBoldsBaselineFile_ShouldEmitItalicBaseline
await That(body).DoesNotContain("**_");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenBdnPreBoldsTheBaselineRow_ShouldNotEmitDoubleBoldOrBreakPrefix()
{
string[] report =
@@ -105,7 +105,7 @@ public async Task BuildBody_WhenBdnPreBoldsTheBaselineRow_ShouldNotEmitDoubleBol
await That(lines).Contains("| Moq | 1 | 212 ns | 20.37 KB |");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenInvocationCountAndMeanMatch_ShouldInjectBaseline()
{
string[] report =
@@ -128,7 +128,7 @@ public async Task BuildBody_WhenInvocationCountAndMeanMatch_ShouldInjectBaseline
await That(body).Contains("_95 ns_");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenTableHasEmptyRowSeparatingParameterGroups_ShouldEmitEmptyRowMatchingHeaderColumnCount()
{
string[] report =
@@ -153,7 +153,7 @@ public async Task BuildBody_WhenTableHasEmptyRowSeparatingParameterGroups_Should
await That(lines[firstGroupLast + 1]).IsEqualTo("| | | | |");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenTableHasEmptyRowSeparatingParameterGroups_ShouldNotEmitBareSeparator()
{
string[] report =
@@ -173,7 +173,7 @@ public async Task BuildBody_WhenTableHasEmptyRowSeparatingParameterGroups_Should
await That(body).DoesNotContain($"{Environment.NewLine}|{Environment.NewLine}");
}
- [Fact]
+ [Test]
public async Task BuildBody_WhenTableHasEmptyRowSeparatingParameterGroups_ShouldStillStripCommonPrefix()
{
string[] report =
@@ -198,7 +198,7 @@ public async Task BuildBody_WhenTableHasEmptyRowSeparatingParameterGroups_Should
await That(lines).Contains("| Moq | 10 | 2000 ns | 20 KB |");
}
- [Fact]
+ [Test]
public async Task BuildBody_WithBaseline_ShouldInjectItalicBaselineRowBeforeMockolateRow()
{
string[] baseline =
@@ -220,7 +220,7 @@ await That(body).Contains(
"`baseline*` rows show the corresponding Mockolate benchmark");
}
- [Fact]
+ [Test]
public async Task BuildBody_WithBaseline_ShouldNormalizeUnitDifferencesWhenComputingRatio()
{
string[] report =
@@ -242,7 +242,7 @@ public async Task BuildBody_WithBaseline_ShouldNormalizeUnitDifferencesWhenCompu
await That(body).Contains("| _baseline*_ | _1.00 μs_ | _2.00_ | _2048 B_ | _2.00_ |");
}
- [Fact]
+ [Test]
public async Task BuildBody_WithBaseline_ShouldRecomputeAllocRatioRelativeToCurrentMockolate()
{
string[] report =
@@ -264,7 +264,7 @@ public async Task BuildBody_WithBaseline_ShouldRecomputeAllocRatioRelativeToCurr
await That(body).Contains("| _baseline*_ | _100 ns_ | _1.00_ | _1024 B_ | _0.50_ |");
}
- [Fact]
+ [Test]
public async Task BuildBody_WithBaseline_ShouldRecomputeRatioRelativeToCurrentMockolate()
{
string[] report =
@@ -287,7 +287,7 @@ public async Task BuildBody_WithBaseline_ShouldRecomputeRatioRelativeToCurrentMo
await That(body).Contains("| _baseline*_ | _206.44 ns_ | _0.95_ | _1048 B_ | _1.00_ |");
}
- [Fact]
+ [Test]
public async Task BuildBody_WithoutBaseline_ShouldNotEmitBaselineNote()
{
BenchmarkReportFile file = new(_reportLines, null);
@@ -297,7 +297,7 @@ public async Task BuildBody_WithoutBaseline_ShouldNotEmitBaselineNote()
await That(body).DoesNotContain("baseline*");
}
- [Fact]
+ [Test]
public async Task BuildBody_WithoutBaseline_ShouldRenderHeaderAndStripCommonPrefix()
{
BenchmarkReportFile file = new(_reportLines, null);
diff --git a/Tests/Build.Tests/Usings.cs b/Tests/Build.Tests/Usings.cs
index 52cb76276..e340341f7 100644
--- a/Tests/Build.Tests/Usings.cs
+++ b/Tests/Build.Tests/Usings.cs
@@ -2,6 +2,5 @@
global using System.Collections.Generic;
global using System.Threading.Tasks;
global using Build;
-global using Xunit;
global using aweXpect;
global using static aweXpect.Expect;
diff --git a/Tests/Directory.Build.props b/Tests/Directory.Build.props
index 9867a05b3..1c3c25905 100644
--- a/Tests/Directory.Build.props
+++ b/Tests/Directory.Build.props
@@ -16,30 +16,33 @@
701;1702;CA1845
-
- exe
+
+
+ Exe
+ false
+ false
+
+ false
-
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
-
-
- runtime; build; native; contentfiles; analyzers; buildtransitive
- all
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Tests/Mockolate.Analyzers.Tests/AnalyzerHelpersTests.cs b/Tests/Mockolate.Analyzers.Tests/AnalyzerHelpersTests.cs
index a0215a91d..c925303c6 100644
--- a/Tests/Mockolate.Analyzers.Tests/AnalyzerHelpersTests.cs
+++ b/Tests/Mockolate.Analyzers.Tests/AnalyzerHelpersTests.cs
@@ -4,14 +4,13 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Xunit;
using static aweXpect.Expect;
namespace Mockolate.Analyzers.Tests;
public class AnalyzerHelpersTests
{
- [Fact]
+ [Test]
public async Task WhenInvocationHasGenericNameSyntax_ShouldReturnTypeArgumentLocation()
{
const string source = """
@@ -39,7 +38,7 @@ public class C
await That(result).IsNotNull();
}
- [Fact]
+ [Test]
public async Task WhenInvokedMethodIsGeneric_ShouldReturnFirstTypeArgument()
{
const string source = """
@@ -57,7 +56,7 @@ public class C
await That(result!.SpecialType).IsEqualTo(SpecialType.System_Int32);
}
- [Fact]
+ [Test]
public async Task WhenInvokedMethodIsNotGeneric_ShouldNotReturnAnyTypeArgument()
{
const string source = """
@@ -74,7 +73,7 @@ public void Foo() { }
await That(result).IsNull();
}
- [Fact]
+ [Test]
public async Task WhenSyntaxIsNotInvocationExpression_ShouldNotReturnAnyLocation()
{
const string source = """
diff --git a/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerAccessibilityTests.cs b/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerAccessibilityTests.cs
index cd7c08a95..edecaa905 100644
--- a/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerAccessibilityTests.cs
+++ b/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerAccessibilityTests.cs
@@ -1,16 +1,15 @@
using System.Threading.Tasks;
-using Xunit;
using Verifier = Mockolate.Analyzers.Tests.Verifiers.CSharpAnalyzerVerifier;
namespace Mockolate.Analyzers.Tests;
public class MockabilityAnalyzerAccessibilityTests
{
- [Theory]
- [InlineData("internal abstract void MyMember();", "Ext.MyExternalType.MyMember()")]
- [InlineData("internal abstract int MyMember { get; set; }", "Ext.MyExternalType.MyMember.get")]
- [InlineData("internal abstract event System.EventHandler MyMember;", "Ext.MyExternalType.MyMember")]
- [InlineData("public abstract string MyMember { get; internal set; }", "Ext.MyExternalType.MyMember.set")]
+ [Test]
+ [Arguments("internal abstract void MyMember();", "Ext.MyExternalType.MyMember()")]
+ [Arguments("internal abstract int MyMember { get; set; }", "Ext.MyExternalType.MyMember.get")]
+ [Arguments("internal abstract event System.EventHandler MyMember;", "Ext.MyExternalType.MyMember")]
+ [Arguments("public abstract string MyMember { get; internal set; }", "Ext.MyExternalType.MyMember.set")]
public async Task WhenAbstractMemberOfReferencedAssemblyIsNotAccessible_ShouldBeFlagged(
string member, string reportedMember) => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
@@ -22,7 +21,7 @@ public async Task WhenAbstractMemberOfReferencedAssemblyIsNotAccessible_ShouldBe
$"the member '{reportedMember}' must be implemented, but it is not accessible from this assembly")
);
- [Fact]
+ [Test]
public async Task WhenInterfaceAccessorOfReferencedAssemblyIsNotAccessible_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
@@ -33,7 +32,7 @@ public async Task WhenInterfaceAccessorOfReferencedAssemblyIsNotAccessible_Shoul
"the member 'Ext.MyExternalType.MyMember.set' must be implemented, but it is not accessible from this assembly")
);
- [Fact]
+ [Test]
public async Task WhenInaccessibleAbstractMemberIsInheritedFromABaseType_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
@@ -56,16 +55,16 @@ public abstract class MyExternalType : MyBaseType
"the member 'Ext.MyBaseType.MyMember()' must be implemented, but it is not accessible from this assembly")
);
- [Theory]
- [InlineData("internal abstract void MyMember();", "internal override void MyMember() { }")]
- [InlineData("internal abstract int MyMember { get; set; }", "internal override int MyMember { get; set; }")]
- [InlineData("internal abstract event System.EventHandler MyMember;",
+ [Test]
+ [Arguments("internal abstract void MyMember();", "internal override void MyMember() { }")]
+ [Arguments("internal abstract int MyMember { get; set; }", "internal override int MyMember { get; set; }")]
+ [Arguments("internal abstract event System.EventHandler MyMember;",
"internal override event System.EventHandler MyMember;")]
- [InlineData("public abstract string MyMember { get; internal set; }",
+ [Arguments("public abstract string MyMember { get; internal set; }",
"public override string MyMember { get => null!; internal set { } }")]
- [InlineData("public abstract string MyMember { internal get; set; }",
+ [Arguments("public abstract string MyMember { internal get; set; }",
"public override string MyMember { internal get => null!; set { } }")]
- [InlineData("private protected abstract int MyMember { get; set; }",
+ [Arguments("private protected abstract int MyMember { get; set; }",
"private protected override int MyMember { get; set; }")]
public async Task WhenInaccessibleAbstractMemberIsAlreadyOverridden_ShouldNotBeFlagged(
string baseMember, string derivedOverride) => await Verifier
@@ -86,7 +85,7 @@ public abstract class MyExternalType : MyBaseType
}
""");
- [Fact]
+ [Test]
public async Task WhenInaccessibleInterfaceMemberHasADefaultImplementation_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
@@ -105,7 +104,7 @@ void IMyBaseType.MyMember() { }
}
""");
- [Fact]
+ [Test]
public async Task WhenInaccessibleAbstractMemberIsReDeclaredAsAbstract_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
@@ -129,38 +128,38 @@ public abstract class MyExternalType : MyBaseType
"the member 'Ext.MyExternalType.MyMember()' must be implemented, but it is not accessible from this assembly")
);
- [Theory]
- [InlineData("internal abstract void MyMember();")]
- [InlineData("public abstract string MyMember { get; internal set; }")]
+ [Test]
+ [Arguments("internal abstract void MyMember();")]
+ [Arguments("public abstract string MyMember { get; internal set; }")]
public async Task WhenInternalsAreVisibleToTheMockAssembly_ShouldNotBeFlagged(string member) => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
ExternalType("abstract class", member, internalsVisibleToTestProject: true));
- [Theory]
- [InlineData("internal virtual void MyMember() { }")]
- [InlineData("internal virtual int MyMember { get; set; }")]
+ [Test]
+ [Arguments("internal virtual void MyMember() { }")]
+ [Arguments("internal virtual int MyMember { get; set; }")]
public async Task WhenInaccessibleMemberIsOnlyVirtual_ShouldNotBeFlagged(string member) => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
ExternalType("class", member));
- [Fact]
+ [Test]
public async Task WhenProtectedInternalAbstractMember_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
ExternalType("abstract class", "protected internal abstract void MyMember();"));
- [Theory]
- [InlineData("protected abstract void MyMember(MyConfiguration configuration);",
+ [Test]
+ [Arguments("protected abstract void MyMember(MyConfiguration configuration);",
"Ext.MyExternalType.MyMember(Ext.MyExternalType.MyConfiguration)", "Ext.MyExternalType.MyConfiguration")]
- [InlineData("protected abstract MyConfiguration MyMember();", "Ext.MyExternalType.MyMember()",
+ [Arguments("protected abstract MyConfiguration MyMember();", "Ext.MyExternalType.MyMember()",
"Ext.MyExternalType.MyConfiguration")]
- [InlineData("protected abstract MyConfiguration MyMember { get; set; }", "Ext.MyExternalType.MyMember",
+ [Arguments("protected abstract MyConfiguration MyMember { get; set; }", "Ext.MyExternalType.MyMember",
"Ext.MyExternalType.MyConfiguration")]
- [InlineData("protected abstract void MyMember() where T : MyConfiguration;",
+ [Arguments("protected abstract void MyMember() where T : MyConfiguration;",
"Ext.MyExternalType.MyMember()", "Ext.MyExternalType.MyConfiguration")]
- [InlineData("protected abstract System.Collections.Generic.List MyMember();",
+ [Arguments("protected abstract System.Collections.Generic.List MyMember();",
"Ext.MyExternalType.MyMember()", "System.Collections.Generic.List")]
public async Task WhenAbstractMemberSignatureUsesAnInaccessibleType_ShouldBeFlagged(
string member, string reportedMember, string reportedType) => await Verifier
@@ -176,7 +175,7 @@ protected internal class MyConfiguration { }
$"the member '{reportedMember}' must be implemented, but its signature uses the type '{reportedType}', which is not accessible from this assembly")
);
- [Fact]
+ [Test]
public async Task WhenAbstractMemberSignatureUsesATypeVisibleToTheMockAssembly_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
@@ -185,10 +184,10 @@ public async Task WhenAbstractMemberSignatureUsesATypeVisibleToTheMockAssembly_S
protected internal class MyConfiguration { }
""", internalsVisibleToTestProject: true));
- [Theory]
- [InlineData("protected abstract void MyMember(MyConfiguration configuration);",
+ [Test]
+ [Arguments("protected abstract void MyMember(MyConfiguration configuration);",
"protected override void MyMember(MyConfiguration configuration) { }")]
- [InlineData("protected abstract MyConfiguration MyMember { get; set; }",
+ [Arguments("protected abstract MyConfiguration MyMember { get; set; }",
"protected override MyConfiguration MyMember { get; set; }")]
public async Task WhenAbstractMemberWithInaccessibleSignatureIsAlreadyOverridden_ShouldNotBeFlagged(
string baseMember, string derivedOverride) => await Verifier
@@ -210,11 +209,11 @@ public class MyExternalType : MyBaseType
}
""");
- [Theory]
- [InlineData("private protected abstract void MyMember();", "Ext.MyExternalType.MyMember()")]
- [InlineData("private protected abstract int MyMember { get; set; }", "Ext.MyExternalType.MyMember.get")]
- [InlineData("private protected abstract event System.EventHandler MyMember;", "Ext.MyExternalType.MyMember")]
- [InlineData("public abstract string MyMember { get; private protected set; }", "Ext.MyExternalType.MyMember.set")]
+ [Test]
+ [Arguments("private protected abstract void MyMember();", "Ext.MyExternalType.MyMember()")]
+ [Arguments("private protected abstract int MyMember { get; set; }", "Ext.MyExternalType.MyMember.get")]
+ [Arguments("private protected abstract event System.EventHandler MyMember;", "Ext.MyExternalType.MyMember")]
+ [Arguments("public abstract string MyMember { get; private protected set; }", "Ext.MyExternalType.MyMember.set")]
public async Task WhenPrivateProtectedAbstractMemberIsNotAccessible_ShouldBeFlagged(
string member, string reportedMember) => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
@@ -226,17 +225,17 @@ public async Task WhenPrivateProtectedAbstractMemberIsNotAccessible_ShouldBeFlag
$"the member '{reportedMember}' must be implemented, but it is not accessible from this assembly")
);
- [Theory]
- [InlineData("private protected abstract void MyMember();")]
- [InlineData("private protected abstract event System.EventHandler MyMember;")]
- [InlineData("public abstract string MyMember { get; private protected set; }")]
+ [Test]
+ [Arguments("private protected abstract void MyMember();")]
+ [Arguments("private protected abstract event System.EventHandler MyMember;")]
+ [Arguments("public abstract string MyMember { get; private protected set; }")]
public async Task WhenPrivateProtectedAbstractMemberIsVisibleToTheMockAssembly_ShouldNotBeFlagged(string member)
=> await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
MockCreation,
ExternalType("abstract class", member, internalsVisibleToTestProject: true));
- [Fact]
+ [Test]
public async Task WhenAdditionalInterfaceHasAnInaccessibleMember_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
ImplementingMockCreation,
@@ -247,7 +246,7 @@ public async Task WhenAdditionalInterfaceHasAnInaccessibleMember_ShouldBeFlagged
"the member 'Ext.MyExternalType.MyMember()' must be implemented, but it is not accessible from this assembly")
);
- [Fact]
+ [Test]
public async Task WhenAdditionalInterfaceMemberIsVisibleToTheMockAssembly_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerWithReferencedProjectAsync(
ImplementingMockCreation,
diff --git a/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerRefStructTests.cs b/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerRefStructTests.cs
index b319b66fe..16a930fc4 100644
--- a/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerRefStructTests.cs
+++ b/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerRefStructTests.cs
@@ -2,7 +2,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Testing;
-using Xunit;
using Verifier = Mockolate.Analyzers.Tests.Verifiers.CSharpAnalyzerVerifier;
namespace Mockolate.Analyzers.Tests;
@@ -21,7 +20,7 @@ namespace Mockolate.Analyzers.Tests;
///
public class MockabilityAnalyzerRefStructTests
{
- [Fact]
+ [Test]
public async Task WhenLanguageVersionBelowCSharp13_RefReadonlySpanParameterMethod_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -53,7 +52,7 @@ public void MyTest()
"ref-struct parameter mocking requires C# 13 or later (uses the 'allows ref struct' anti-constraint; current LangVersion is 12.0)")
);
- [Fact]
+ [Test]
public async Task WhenLanguageVersionBelowCSharp13_RefStructKeyedIndexer_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -84,7 +83,7 @@ public void MyTest()
"ref-struct-keyed indexers require C# 13 or later (uses the 'allows ref struct' anti-constraint; current LangVersion is 12.0)")
);
- [Fact]
+ [Test]
public async Task WhenLanguageVersionBelowCSharp13_RefStructParameterMethod_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -115,7 +114,7 @@ public void MyTest()
"ref-struct parameter mocking requires C# 13 or later (uses the 'allows ref struct' anti-constraint; current LangVersion is 12.0)")
);
- [Fact]
+ [Test]
public async Task WhenMockingAbstractClassWithInheritedRefStructOutParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -147,7 +146,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingAbstractClassWithRefStructProperty_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -177,7 +176,7 @@ public void MyTest()
"properties of a non-span ref struct type are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingClassWithVirtualInitOnlyRefStructProperty_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -215,7 +214,7 @@ public void MyTest()
"properties of a non-span ref struct type are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingClassWithVirtualRefReturningRefStructMethod_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -247,7 +246,7 @@ public void MyTest()
"methods returning a non-span ref struct are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingClassWithVirtualRefStructIndexer_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -273,7 +272,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingClassWithVirtualRefStructProperty_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -301,7 +300,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingClassWithVirtualRefStructReturnAndParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -329,7 +328,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingClassWithVirtualRefStructReturningMethod_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -355,7 +354,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingDelegateReturningNonSpanRefStruct_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -384,7 +383,7 @@ public void MyTest()
"methods returning a non-span ref struct are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingDelegateWithOutRefStructParameter_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -414,7 +413,7 @@ public void MyTest()
"ref-struct parameters are not supported on delegate types")
);
- [Fact]
+ [Test]
public async Task WhenMockingDelegateWithPlainRefStructParameter_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -444,7 +443,7 @@ public void MyTest()
"ref-struct parameters are not supported on delegate types")
);
- [Fact]
+ [Test]
public async Task WhenMockingDelegateWithRefReadonlySpanParameter_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -471,7 +470,7 @@ public void MyTest()
"ref-struct parameters are not supported on delegate types")
);
- [Fact]
+ [Test]
public async Task WhenMockingDelegateWithSpanParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -494,7 +493,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceInheritingRefStructOutMethod_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -525,7 +524,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceReturningNonSpanRefStruct_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -555,7 +554,7 @@ public void MyTest()
"methods returning a non-span ref struct are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithOutRefStructParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -581,7 +580,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefStructOutAndPlainOverloads_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -610,7 +609,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithPlainRefStructParameter_ShouldNotFlag() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -636,7 +635,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefReadonlyRefStructParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -662,7 +661,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefReadonlySpanParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -688,7 +687,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefRefStructParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -714,7 +713,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefStructIndexerKey_GetterOnly_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -741,7 +740,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefStructIndexerKeyAndSetter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -769,7 +768,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithSpanParameter_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -795,7 +794,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithSpanReturn_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -821,7 +820,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefStructProperty_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -851,7 +850,7 @@ public void MyTest()
"properties of a non-span ref struct type are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithSpanProperty_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -875,7 +874,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithSpanValuedIndexer_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -900,7 +899,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefStructValuedIndexer_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -930,7 +929,7 @@ public void MyTest()
"indexers returning a non-span ref struct are not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingInterfaceWithRefStructEventArgument_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
diff --git a/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerTests.cs b/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerTests.cs
index 7cfca2b6a..e3fa5ebea 100644
--- a/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerTests.cs
+++ b/Tests/Mockolate.Analyzers.Tests/MockabilityAnalyzerTests.cs
@@ -1,12 +1,11 @@
using System.Threading.Tasks;
-using Xunit;
using Verifier = Mockolate.Analyzers.Tests.Verifiers.CSharpAnalyzerVerifier;
namespace Mockolate.Analyzers.Tests;
public class MockabilityAnalyzerTests
{
- [Fact]
+ [Test]
public async Task WhenCreateMockIsNotInMockolateNamespace_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -37,7 +36,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenImplementingAClass_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -66,7 +65,7 @@ public void MyTest()
.WithArguments("MyNamespace.MyImplementingClass", "You can only implement additional interfaces")
);
- [Fact]
+ [Test]
public async Task WhenInvocationIsNotMemberAccess_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -84,7 +83,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMethodNameIsUnrelated_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -103,7 +102,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingADelegate_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -122,7 +121,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingArray_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -148,7 +147,7 @@ public void MyTest()
.WithArguments("MyNamespace.IMyInterface[]", "type kind 'Array' is not supported")
);
- [Fact]
+ [Test]
public async Task WhenMockingClass_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -172,7 +171,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingDelegate_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -193,7 +192,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingEnum_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -221,7 +220,7 @@ public void MyTest()
.WithArguments("MyNamespace.MyEnum", "type is an enum")
);
- [Fact]
+ [Test]
public async Task WhenMockingGlobalNamespaceType_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -248,7 +247,7 @@ public void MyTest()
.WithArguments("IGlobalInterface", "type is declared in the global namespace")
);
- [Fact]
+ [Test]
public async Task WhenMockingInterface_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -272,7 +271,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingOpenGenericClass_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -304,7 +303,7 @@ public void MyTest()
"""
);
- [Fact]
+ [Test]
public async Task WhenMockingRecord_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -328,7 +327,7 @@ public void MyTest()
.WithArguments("MyNamespace.MyRecord", "type is a record")
);
- [Fact]
+ [Test]
public async Task WhenMockingSealedClass_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
@@ -355,7 +354,7 @@ public void MyTest()
.WithArguments("MyNamespace.MySealedClass", "type is sealed")
);
- [Fact]
+ [Test]
public async Task WhenMockingStruct_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
$$"""
diff --git a/Tests/Mockolate.Analyzers.Tests/UseVerificationAnalyzerTests.cs b/Tests/Mockolate.Analyzers.Tests/UseVerificationAnalyzerTests.cs
index de634c27f..d17f448ae 100644
--- a/Tests/Mockolate.Analyzers.Tests/UseVerificationAnalyzerTests.cs
+++ b/Tests/Mockolate.Analyzers.Tests/UseVerificationAnalyzerTests.cs
@@ -1,12 +1,11 @@
using System.Threading.Tasks;
-using Xunit;
using Verifier = Mockolate.Analyzers.Tests.Verifiers.CSharpAnalyzerVerifier;
namespace Mockolate.Analyzers.Tests;
public class UseVerificationAnalyzerTests
{
- [Fact]
+ [Test]
public async Task WhenAssigned_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -26,7 +25,7 @@ public static VerificationResult>> VerifySomething()
"""
);
- [Fact]
+ [Test]
public async Task WhenNotUsed_ShouldBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -48,7 +47,7 @@ public static VerificationResult>> VerifySomething()
.WithLocation(0)
);
- [Fact]
+ [Test]
public async Task WhenPassedAsArgument_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -71,7 +70,7 @@ public static VerificationResult>> VerifySomething()
"""
);
- [Fact]
+ [Test]
public async Task WhenReturnedFromMethod_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -91,7 +90,7 @@ public static VerificationResult>> VerifySomething()
"""
);
- [Fact]
+ [Test]
public async Task WhenUsedAsVariableInitializer_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -112,7 +111,7 @@ public static VerificationResult>> VerifySomething()
"""
);
- [Fact]
+ [Test]
public async Task WhenUsedInConditional_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
@@ -132,7 +131,7 @@ public static VerificationResult>> VerifySomething()
"""
);
- [Fact]
+ [Test]
public async Task WhenUsedInMethod_ShouldNotBeFlagged() => await Verifier
.VerifyAnalyzerAsync(
"""
diff --git a/Tests/Mockolate.Analyzers.Tests/UseVerificationCodeFixProviderTests.cs b/Tests/Mockolate.Analyzers.Tests/UseVerificationCodeFixProviderTests.cs
index a5edd34cf..97e4366fa 100644
--- a/Tests/Mockolate.Analyzers.Tests/UseVerificationCodeFixProviderTests.cs
+++ b/Tests/Mockolate.Analyzers.Tests/UseVerificationCodeFixProviderTests.cs
@@ -1,5 +1,4 @@
using System.Threading.Tasks;
-using Xunit;
using Verifier = Mockolate.Analyzers.Tests.Verifiers.CSharpCodeFixVerifier;
@@ -7,7 +6,7 @@ namespace Mockolate.Analyzers.Tests;
public class UseVerificationCodeFixProviderTests
{
- [Fact]
+ [Test]
public async Task ShouldApplyCodeFix() => await Verifier.VerifyCodeFixAsync(
"""
using Mockolate;
diff --git a/Tests/Mockolate.Api.Tests/ApiApprovalTests.cs b/Tests/Mockolate.Api.Tests/ApiApprovalTests.cs
index 0094f6dec..7b67dfd26 100644
--- a/Tests/Mockolate.Api.Tests/ApiApprovalTests.cs
+++ b/Tests/Mockolate.Api.Tests/ApiApprovalTests.cs
@@ -1,3 +1,4 @@
+using System.Collections.Generic;
using System.Linq;
using aweXpect.Core;
using aweXpect.Results;
@@ -21,15 +22,16 @@ public sealed class ApiApprovalTests
"Mockolate",
];
- [Theory]
- [MemberData(nameof(Builds))]
+ [Test]
+ [MethodDataSource(nameof(Builds))]
public async Task VerifyPublicApi(string assemblyName, string framework)
=> await MatchesPublicApiSnapshot(assemblyName, framework);
///
/// Execute this test to update the expected public API to the current API surface.
///
- [Fact(Explicit = true)]
+ [Test]
+ [Explicit]
public async Task AcceptApiChanges()
{
foreach ((string assemblyName, string framework) in AllBuilds())
@@ -45,8 +47,8 @@ public async Task AcceptApiChanges()
}
}
- public static TheoryData Builds()
- => new(AllBuilds());
+ public static IEnumerable<(string, string)> Builds()
+ => AllBuilds();
///
/// The snapshot is named after the assembly and the target framework, so that both tests use the same one.
diff --git a/Tests/Mockolate.Api.Tests/Mockolate.Api.Tests.csproj b/Tests/Mockolate.Api.Tests/Mockolate.Api.Tests.csproj
index f011f51cd..f82bb7d7e 100644
--- a/Tests/Mockolate.Api.Tests/Mockolate.Api.Tests.csproj
+++ b/Tests/Mockolate.Api.Tests/Mockolate.Api.Tests.csproj
@@ -2,7 +2,6 @@
net8.0
- exe
@@ -10,8 +9,6 @@
-
-
diff --git a/Tests/Mockolate.Api.Tests/Usings.cs b/Tests/Mockolate.Api.Tests/Usings.cs
index 1990b88b3..3dfd9d39f 100644
--- a/Tests/Mockolate.Api.Tests/Usings.cs
+++ b/Tests/Mockolate.Api.Tests/Usings.cs
@@ -1,5 +1,4 @@
global using System;
global using System.Threading.Tasks;
-global using Xunit;
global using aweXpect;
global using static aweXpect.Expect;
diff --git a/Tests/Mockolate.ExampleTests/ExampleTests.cs b/Tests/Mockolate.ExampleTests/ExampleTests.cs
index 3b8ddb8c4..1ba985212 100644
--- a/Tests/Mockolate.ExampleTests/ExampleTests.cs
+++ b/Tests/Mockolate.ExampleTests/ExampleTests.cs
@@ -20,7 +20,7 @@ namespace Mockolate.ExampleTests;
public class ExampleTests
{
- [Fact]
+ [Test]
public async Task Any_ShouldAlwaysMatch()
{
Guid id = Guid.NewGuid();
@@ -42,7 +42,7 @@ public async Task Any_ShouldAlwaysMatch()
}
#if NET8_0_OR_GREATER
- [Fact]
+ [Test]
public async Task Azure_ShouldBeMockable()
{
Response response = Response.CreateMock();
@@ -64,7 +64,7 @@ public async Task Azure_ShouldBeMockable()
}
#endif
- [Fact]
+ [Test]
public async Task BaseClassWithConstructorParameters()
{
MyClass sut = MyClass.CreateMock(3);
@@ -79,10 +79,10 @@ public async Task BaseClassWithConstructorParameters()
}
#if NET8_0_OR_GREATER
- [Theory]
- [InlineData(HttpStatusCode.OK)]
- [InlineData(HttpStatusCode.NotFound)]
- [InlineData(HttpStatusCode.ServiceUnavailable)]
+ [Test]
+ [Arguments(HttpStatusCode.OK)]
+ [Arguments(HttpStatusCode.NotFound)]
+ [Arguments(HttpStatusCode.ServiceUnavailable)]
public async Task HttpClientTest(HttpStatusCode statusCode)
{
HttpClient httpClient = HttpClient.CreateMock();
@@ -94,7 +94,7 @@ public async Task HttpClientTest(HttpStatusCode statusCode)
await That(result.StatusCode).IsEqualTo(statusCode);
}
- [Fact]
+ [Test]
public async Task IHttpClientFactory_SharedHandler_PreservesInvocationsAcrossDisposes()
{
HttpMessageHandler handler = HttpMessageHandler.CreateMock();
@@ -119,7 +119,7 @@ public async Task IHttpClientFactory_SharedHandler_PreservesInvocationsAcrossDis
}
#endif
- [Fact]
+ [Test]
public async Task MockIFileSystem_ShouldWork()
{
IFileSystem sut = IFileSystem.CreateMock(MockBehavior.Default.SkippingBaseClass());
@@ -132,7 +132,7 @@ public async Task MockIFileSystem_ShouldWork()
await That(result).IsEqualTo('a');
}
- [Fact]
+ [Test]
public async Task SimpleInterfaceMock()
{
Guid id = Guid.NewGuid();
@@ -144,7 +144,7 @@ public async Task SimpleInterfaceMock()
sut.Mock.Verify.AddUser(It.IsAny()).Once();
}
- [Fact]
+ [Test]
public async Task WithAdditionalInterface_ShouldWork()
{
Guid id = Guid.NewGuid();
@@ -160,7 +160,7 @@ public async Task WithAdditionalInterface_ShouldWork()
await That(sut).Is();
}
- [Fact]
+ [Test]
public async Task WithAdditionalInterfaceInOtherOrder_ShouldWork()
{
Guid id = Guid.NewGuid();
@@ -172,7 +172,7 @@ public async Task WithAdditionalInterfaceInOtherOrder_ShouldWork()
sut.Mock.As().Verify.AddUser(It.IsAny()).Once();
}
- [Fact]
+ [Test]
public async Task WithEvent_ShouldSupportRaisingEvent()
{
EventArgs eventArgs = EventArgs.Empty;
@@ -197,7 +197,7 @@ void Register(object? sender, EventArgs e)
}
}
- [Fact]
+ [Test]
public async Task WithExplicitCastToAdditionalInterfaceSetup_ShouldWork()
{
Guid id = Guid.NewGuid();
@@ -213,7 +213,7 @@ public async Task WithExplicitCastToAdditionalInterfaceSetup_ShouldWork()
await That(sut).Is();
}
- [Fact]
+ [Test]
public async Task WithExplicitCastToAdditionalInterfaceVerify_ShouldWork()
{
Guid id = Guid.NewGuid();
@@ -230,9 +230,9 @@ public async Task WithExplicitCastToAdditionalInterfaceVerify_ShouldWork()
await That(sut).Is();
}
- [Theory]
- [InlineData("Alice", true)]
- [InlineData("Bob", false)]
+ [Test]
+ [Arguments("Alice", true)]
+ [Arguments("Bob", false)]
public async Task WithMatching_ShouldAlwaysMatch(string name, bool expectResult)
{
Guid id = Guid.NewGuid();
@@ -248,9 +248,9 @@ public async Task WithMatching_ShouldAlwaysMatch(string name, bool expectResult)
sut.Mock.Verify.AddUser(It.Is(name)).Once();
}
- [Theory]
- [InlineData(false)]
- [InlineData(true)]
+ [Test]
+ [Arguments(false)]
+ [Arguments(true)]
public async Task WithOut_ShouldSupportOutParameter(bool returnValue)
{
Guid id = Guid.NewGuid();
@@ -268,7 +268,7 @@ public async Task WithOut_ShouldSupportOutParameter(bool returnValue)
sut.Mock.Verify.TryDelete(It.Is(id), It.IsOut()).Once();
}
- [Fact]
+ [Test]
public async Task Wrapping_HiddenMember_ShouldForwardToDeclaringInterface()
{
User alice = new(Guid.NewGuid(), "Alice");
diff --git a/Tests/Mockolate.ExampleTests/Usings.cs b/Tests/Mockolate.ExampleTests/Usings.cs
index ac90007f3..b95ed5935 100644
--- a/Tests/Mockolate.ExampleTests/Usings.cs
+++ b/Tests/Mockolate.ExampleTests/Usings.cs
@@ -1,3 +1,2 @@
-global using Xunit;
-global using aweXpect;
+global using aweXpect;
global using static aweXpect.Expect;
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/ChunkedSlotStorageTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/ChunkedSlotStorageTests.cs
index c37e02dcf..a3a12e22d 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/ChunkedSlotStorageTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/ChunkedSlotStorageTests.cs
@@ -6,7 +6,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class ChunkedSlotStorageTests
{
- [Fact]
+ [Test]
public async Task Clear_AfterMultipleChunks_ResetsCountAndAllowsRefill()
{
const int total = (ChunkedSlotStorage.ChunkSize * 2) + 5;
@@ -28,7 +28,7 @@ public async Task Clear_AfterMultipleChunks_ResetsCountAndAllowsRefill()
await That(((MethodInvocation)store.Single()).Parameter1).IsEqualTo(99);
}
- [Fact]
+ [Test]
public async Task SlotForWrite_AcrossMultipleChunks_PreservesAllRecords()
{
const int total = ChunkedSlotStorage.ChunkSize * 3;
@@ -50,7 +50,7 @@ public async Task SlotForWrite_AcrossMultipleChunks_PreservesAllRecords()
}
}
- [Fact]
+ [Test]
public async Task SlotForWrite_BeyondInitialChunksArrayLength_ExpandsArrayUnderLock()
{
const int total = (ChunkedSlotStorage.ChunkSize * 4) + 1;
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastBufferBoxingAndUnverifiedTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastBufferBoxingAndUnverifiedTests.cs
index ca80889d6..9208cc33b 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastBufferBoxingAndUnverifiedTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastBufferBoxingAndUnverifiedTests.cs
@@ -8,7 +8,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastBufferBoxingAndUnverifiedTests
{
- [Fact]
+ [Test]
public async Task FastEventBuffer_AppendBoxed_KindMatters()
{
FastMockInteractions subscribeStore = new(1);
@@ -23,7 +23,7 @@ public async Task FastEventBuffer_AppendBoxed_KindMatters()
await That(unsubscribeStore.Single()).IsExactly();
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -47,7 +47,7 @@ public async Task FastEventBuffer_AppendBoxedUnverified_ShouldSkipMatchedSlots()
await That(dest[0].Interaction).IsExactly();
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_Subscribe_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new EventSubscription(...)` cache in AppendBoxed. With the
@@ -66,7 +66,7 @@ public async Task FastEventBuffer_Subscribe_AppendBoxed_CachesAndReusesAlreadyBo
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_Subscribe_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new EventSubscription(...)` cache in AppendBoxedUnverified.
@@ -84,7 +84,7 @@ public async Task FastEventBuffer_Subscribe_AppendBoxedUnverified_CachesAndReuse
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_SubscribeAppend_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -92,7 +92,7 @@ public async Task FastEventBuffer_SubscribeAppend_ShouldRaiseInteractionAdded()
return () => buffer.Append("E", this, SampleMethod);
});
- [Fact]
+ [Test]
public async Task FastEventBuffer_Unsubscribe_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -109,7 +109,7 @@ public async Task FastEventBuffer_Unsubscribe_AppendBoxed_CachesAndReusesAlready
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_Unsubscribe_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -126,7 +126,7 @@ public async Task FastEventBuffer_Unsubscribe_AppendBoxedUnverified_CachesAndReu
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_Unsubscribe_AppendBoxedUnverified_ShouldBoxAsEventUnsubscription()
{
FastMockInteractions store = new(1);
@@ -142,7 +142,7 @@ await That(dest[0].Interaction).IsExactly()
"the `_kind == FastEventBufferKind.Subscribe` ternary in AppendBoxedUnverified must pick the record type from the buffer kind, so an unsubscribe buffer never surfaces EventSubscription");
}
- [Fact]
+ [Test]
public async Task FastEventBuffer_UnsubscribeAppend_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -150,7 +150,7 @@ public async Task FastEventBuffer_UnsubscribeAppend_ShouldRaiseInteractionAdded(
return () => buffer.Append("E", this, SampleMethod);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer1_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -158,7 +158,7 @@ public async Task FastIndexerGetterBuffer1_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer1_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -176,7 +176,7 @@ public async Task FastIndexerGetterBuffer1_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer1_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -194,7 +194,7 @@ public async Task FastIndexerGetterBuffer1_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer1_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -203,7 +203,7 @@ public async Task FastIndexerGetterBuffer1_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer2_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -211,7 +211,7 @@ public async Task FastIndexerGetterBuffer2_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a");
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer2_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -229,7 +229,7 @@ public async Task FastIndexerGetterBuffer2_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer2_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -247,7 +247,7 @@ public async Task FastIndexerGetterBuffer2_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer2_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -256,7 +256,7 @@ public async Task FastIndexerGetterBuffer2_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer3_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -265,7 +265,7 @@ public async Task FastIndexerGetterBuffer3_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a", true);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer3_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -284,7 +284,7 @@ public async Task FastIndexerGetterBuffer3_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer3_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -303,7 +303,7 @@ public async Task FastIndexerGetterBuffer3_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer3_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -313,7 +313,7 @@ public async Task FastIndexerGetterBuffer3_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer4_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -322,7 +322,7 @@ public async Task FastIndexerGetterBuffer4_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a", true, 1.0);
});
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer4_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -341,7 +341,7 @@ public async Task FastIndexerGetterBuffer4_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer4_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -360,7 +360,7 @@ public async Task FastIndexerGetterBuffer4_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer4_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -370,7 +370,7 @@ public async Task FastIndexerGetterBuffer4_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer1_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -378,7 +378,7 @@ public async Task FastIndexerSetterBuffer1_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a");
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer1_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -396,7 +396,7 @@ public async Task FastIndexerSetterBuffer1_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer1_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -414,7 +414,7 @@ public async Task FastIndexerSetterBuffer1_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer1_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -423,7 +423,7 @@ public async Task FastIndexerSetterBuffer1_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer2_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -432,7 +432,7 @@ public async Task FastIndexerSetterBuffer2_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a", true);
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer2_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -451,7 +451,7 @@ public async Task FastIndexerSetterBuffer2_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer2_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -470,7 +470,7 @@ public async Task FastIndexerSetterBuffer2_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer2_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -480,7 +480,7 @@ public async Task FastIndexerSetterBuffer2_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer3_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -489,7 +489,7 @@ public async Task FastIndexerSetterBuffer3_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a", true, 1.0);
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer3_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -508,7 +508,7 @@ public async Task FastIndexerSetterBuffer3_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer3_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -527,7 +527,7 @@ public async Task FastIndexerSetterBuffer3_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer3_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -537,7 +537,7 @@ public async Task FastIndexerSetterBuffer3_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer4_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -546,7 +546,7 @@ public async Task FastIndexerSetterBuffer4_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append(1, "a", true, 1.0, 'x');
});
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer4_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -565,7 +565,7 @@ public async Task FastIndexerSetterBuffer4_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer4_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -584,7 +584,7 @@ public async Task FastIndexerSetterBuffer4_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer4_AppendWithAccess_ShouldPublishAndRaiseInteractionAdded()
=> await VerifyAppendWithAccessPublishesAndRaises(store =>
{
@@ -594,7 +594,7 @@ public async Task FastIndexerSetterBuffer4_AppendWithAccess_ShouldPublishAndRais
return (() => buffer.Append(access), () => buffer.Count);
});
- [Fact]
+ [Test]
public async Task FastMethod0Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new MethodInvocation(r.Name)` cache in Method0 AppendBoxed.
@@ -614,7 +614,7 @@ public async Task FastMethod0Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecor
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastMethod1Buffer_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -623,7 +623,7 @@ public async Task FastMethod1Buffer_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append("M", 1);
});
- [Fact]
+ [Test]
public async Task FastMethod1Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -642,7 +642,7 @@ public async Task FastMethod1Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecor
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastMethod2Buffer_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -651,7 +651,7 @@ public async Task FastMethod2Buffer_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append("M", 1, "a");
});
- [Fact]
+ [Test]
public async Task FastMethod3Buffer_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -659,7 +659,7 @@ public async Task FastMethod3Buffer_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append("M", 1, "a", true);
});
- [Fact]
+ [Test]
public async Task FastMethod3Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new MethodInvocation(...)` cache in Method3 AppendBoxed.
@@ -678,7 +678,7 @@ public async Task FastMethod3Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecor
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastMethod3Buffer_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new MethodInvocation(...)` cache in Method3 AppendBoxedUnverified.
@@ -697,7 +697,7 @@ public async Task FastMethod3Buffer_AppendBoxedUnverified_CachesAndReusesAlready
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastMethod3Buffer_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -719,7 +719,7 @@ public async Task FastMethod3Buffer_AppendBoxedUnverified_ShouldSkipMatchedSlots
await That(((MethodInvocation)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task FastMethod4Buffer_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -728,7 +728,7 @@ public async Task FastMethod4Buffer_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append("M", 1, "a", true, 1.0);
});
- [Fact]
+ [Test]
public async Task FastMethod4Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new MethodInvocation(...)` cache in Method4 AppendBoxed.
@@ -748,7 +748,7 @@ public async Task FastMethod4Buffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecor
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastMethod4Buffer_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
// Pins the `r.Boxed ??= new MethodInvocation(...)` cache in Method4 AppendBoxedUnverified.
@@ -768,7 +768,7 @@ public async Task FastMethod4Buffer_AppendBoxedUnverified_CachesAndReusesAlready
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastMethod4Buffer_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -792,7 +792,7 @@ public async Task FastMethod4Buffer_AppendBoxedUnverified_ShouldSkipMatchedSlots
await That(((MethodInvocation)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task FastPropertyGetterBuffer_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -800,7 +800,7 @@ public async Task FastPropertyGetterBuffer_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append();
});
- [Fact]
+ [Test]
public async Task FastPropertyGetterBuffer_AppendBoxed_RepeatedCallsReturnSameSingleton()
{
FastMockInteractions store = new(1);
@@ -818,7 +818,7 @@ public async Task FastPropertyGetterBuffer_AppendBoxed_RepeatedCallsReturnSameSi
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastPropertyGetterBuffer_AppendBoxed_SharesSingletonAcrossRecords()
{
// All recorded getter accesses for the same property surface as one PropertyGetterAccess
@@ -840,7 +840,7 @@ public async Task FastPropertyGetterBuffer_AppendBoxed_SharesSingletonAcrossReco
await That(dest[0].Interaction).IsSameAs(dest[1].Interaction);
}
- [Fact]
+ [Test]
public async Task FastPropertyGetterBuffer_AppendString_LazyInitsAccessOnce()
{
FastMockInteractions store = new(1);
@@ -860,7 +860,7 @@ public async Task FastPropertyGetterBuffer_AppendString_LazyInitsAccessOnce()
await That(secondSnapshot[1].Interaction).IsSameAs(firstSnapshot[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastPropertySetterBuffer_Append_ShouldRaiseInteractionAdded()
=> await VerifyRaisesInteractionAdded(store =>
{
@@ -868,7 +868,7 @@ public async Task FastPropertySetterBuffer_Append_ShouldRaiseInteractionAdded()
return () => buffer.Append("P", 1);
});
- [Fact]
+ [Test]
public async Task FastPropertySetterBuffer_AppendBoxed_CachesAndReusesAlreadyBoxedRecord()
{
FastMockInteractions store = new(1);
@@ -886,7 +886,7 @@ public async Task FastPropertySetterBuffer_AppendBoxed_CachesAndReusesAlreadyBox
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastPropertySetterBuffer_AppendBoxedUnverified_CachesAndReusesAlreadyBoxedRecord()
{
// Mirrors the AppendBoxed caching test for the Unverified path so the `r.Boxed ??= new
@@ -906,7 +906,7 @@ public async Task FastPropertySetterBuffer_AppendBoxedUnverified_CachesAndReuses
await That(second[0].Interaction).IsSameAs(first[0].Interaction);
}
- [Fact]
+ [Test]
public async Task FastPropertySetterBuffer_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
// Covers the AppendBoxedUnverified branch on the setter buffer (NoCoverage cluster).
@@ -926,7 +926,7 @@ public async Task FastPropertySetterBuffer_AppendBoxedUnverified_ShouldSkipMatch
await That(((PropertySetterAccess)dest[1].Interaction).Value).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task FastPropertySetterBuffer_ConsumeMatching_ShouldMarkSlotsVerified()
{
FastMockInteractions store = new(1);
@@ -945,7 +945,7 @@ await That(dest).IsEmpty()
"ConsumeMatching must write `_storage.VerifiedUnderLock(slot) = true`, otherwise the matched slots stay unverified and a second call would re-count the same records");
}
- [Fact]
+ [Test]
public async Task IndexerGetterBuffer1_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -964,7 +964,7 @@ public async Task IndexerGetterBuffer1_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerGetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerGetterBuffer2_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -985,7 +985,7 @@ public async Task IndexerGetterBuffer2_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerGetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerGetterBuffer3_AppendBoxed_BoxesAsIndexerGetterAccess()
{
FastMockInteractions store = new(1);
@@ -1001,7 +1001,7 @@ public async Task IndexerGetterBuffer3_AppendBoxed_BoxesAsIndexerGetterAccess()
await That(boxed.Parameter3).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGetterBuffer3_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -1024,7 +1024,7 @@ public async Task IndexerGetterBuffer3_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerGetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerGetterBuffer4_AppendBoxed_BoxesAsIndexerGetterAccess()
{
FastMockInteractions store = new(1);
@@ -1041,7 +1041,7 @@ public async Task IndexerGetterBuffer4_AppendBoxed_BoxesAsIndexerGetterAccess()
await That(boxed.Parameter4).IsEqualTo(3.14);
}
- [Fact]
+ [Test]
public async Task IndexerGetterBuffer4_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -1065,7 +1065,7 @@ public async Task IndexerGetterBuffer4_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerGetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerSetterBuffer1_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -1086,7 +1086,7 @@ public async Task IndexerSetterBuffer1_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerSetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerSetterBuffer2_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -1109,7 +1109,7 @@ public async Task IndexerSetterBuffer2_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerSetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerSetterBuffer3_AppendBoxed_BoxesAsIndexerSetterAccess()
{
FastMockInteractions store = new(1);
@@ -1126,7 +1126,7 @@ public async Task IndexerSetterBuffer3_AppendBoxed_BoxesAsIndexerSetterAccess()
await That(boxed.TypedValue).IsEqualTo(3.14);
}
- [Fact]
+ [Test]
public async Task IndexerSetterBuffer3_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
@@ -1150,7 +1150,7 @@ public async Task IndexerSetterBuffer3_AppendBoxedUnverified_ShouldSkipMatchedSl
await That(((IndexerSetterAccess)dest[1].Interaction).Parameter1).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerSetterBuffer4_AppendBoxed_BoxesAsIndexerSetterAccess()
{
FastMockInteractions store = new(1);
@@ -1168,7 +1168,7 @@ public async Task IndexerSetterBuffer4_AppendBoxed_BoxesAsIndexerSetterAccess()
await That(boxed.TypedValue).IsEqualTo('z');
}
- [Fact]
+ [Test]
public async Task IndexerSetterBuffer4_AppendBoxedUnverified_ShouldSkipMatchedSlots()
{
FastMockInteractions store = new(1);
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConcurrencyTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConcurrencyTests.cs
index c97bf0a44..5dc36e5af 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConcurrencyTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConcurrencyTests.cs
@@ -6,8 +6,8 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastBufferConcurrencyTests
{
- [Fact]
- public async Task FastMethod1Buffer_ConcurrentAppend_ShouldRecordAllInteractions()
+ [Test]
+ public async Task FastMethod1Buffer_ConcurrentAppend_ShouldRecordAllInteractions(CancellationToken cancellationToken)
{
const int writerCount = 8;
const int appendsPerWriter = 1000;
@@ -15,11 +15,6 @@ public async Task FastMethod1Buffer_ConcurrentAppend_ShouldRecordAllInteractions
FastMockInteractions store = new(1);
FastMethod1Buffer buffer = store.GetOrCreateBuffer>(0,
static f => new FastMethod1Buffer(f));
-#if NET48
- CancellationToken cancellationToken = TestContext.Current.CancellationToken;
-#else
- CancellationToken cancellationToken = CancellationToken.None;
-#endif
Task[] writers = new Task[writerCount];
for (int w = 0; w < writerCount; w++)
@@ -41,7 +36,7 @@ await That(buffer.ConsumeMatching((IParameterMatch)It.IsAny()))
.IsEqualTo(writerCount * appendsPerWriter);
}
- [Fact]
+ [Test]
public async Task FastMethod1Buffer_InteractionAdded_ShouldFireWhenSubscribed()
{
FastMockInteractions store = new(1);
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConsumeMatchingTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConsumeMatchingTests.cs
index 271e577dc..c0cc884a4 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConsumeMatchingTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastBufferConsumeMatchingTests.cs
@@ -6,7 +6,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastBufferConsumeMatchingTests
{
- [Fact]
+ [Test]
public async Task FastEventBuffer_ConsumeMatching_ShouldReturnCount()
{
FastMockInteractions store = new(1);
@@ -23,7 +23,7 @@ public async Task FastEventBuffer_ConsumeMatching_ShouldReturnCount()
await That(buffer.ConsumeMatching()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer1_ConsumeMatching_ShouldHonorMatcher()
{
FastMockInteractions store = new(1);
@@ -39,7 +39,7 @@ public async Task FastIndexerGetterBuffer1_ConsumeMatching_ShouldHonorMatcher()
await That(buffer.ConsumeMatching((IParameterMatch)It.Is(99))).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer2_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -58,7 +58,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.Is("a"))).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer3_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -84,7 +84,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.Is(false))).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastIndexerGetterBuffer4_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -113,7 +113,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.IsAny())).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer1_ConsumeMatching_ShouldHonorMatchers()
{
FastMockInteractions store = new(1);
@@ -135,7 +135,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.IsAny())).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer2_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -161,7 +161,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.IsAny())).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer3_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -190,7 +190,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.IsAny())).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastIndexerSetterBuffer4_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -222,7 +222,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.IsAny())).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod0Buffer_ConsumeMatching_ShouldReturnCount()
{
FastMockInteractions store = new(1);
@@ -238,7 +238,7 @@ public async Task FastMethod0Buffer_ConsumeMatching_ShouldReturnCount()
await That(buffer.ConsumeMatching()).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task FastMethod1Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWithoutThrowing()
{
FastMockInteractions store = new(1);
@@ -252,7 +252,7 @@ await That(consumed).IsEqualTo(0)
"the `slot < n` loop bound in Method1 ConsumeAll must keep an empty buffer out of the loop; entering it at slot 0 would dereference the not-yet-allocated VerifiedChunks[0]");
}
- [Fact]
+ [Test]
public async Task FastMethod1Buffer_ConsumeMatching_ShouldHonorMatcher()
{
FastMockInteractions store = new(1);
@@ -268,7 +268,7 @@ public async Task FastMethod1Buffer_ConsumeMatching_ShouldHonorMatcher()
await That(buffer.ConsumeMatching((IParameterMatch)It.Is(99))).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod2Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWithoutThrowing()
{
FastMockInteractions store = new(1);
@@ -280,7 +280,7 @@ public async Task FastMethod2Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWit
await That(consumed).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod2Buffer_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -305,7 +305,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.IsAny())).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod3Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWithoutThrowing()
{
FastMockInteractions store = new(1);
@@ -317,7 +317,7 @@ public async Task FastMethod3Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWit
await That(consumed).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod3Buffer_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -346,7 +346,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.Is(false))).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod4Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWithoutThrowing()
{
FastMockInteractions store = new(1);
@@ -359,7 +359,7 @@ public async Task FastMethod4Buffer_ConsumeAll_OnEmptyBuffer_ShouldReturnZeroWit
await That(consumed).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastMethod4Buffer_ConsumeMatching_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -398,7 +398,7 @@ await That(buffer.ConsumeMatching(
(IParameterMatch)It.Is(99.0))).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task FastPropertyGetterBuffer_ConsumeMatching_ShouldReturnCount()
{
FastMockInteractions store = new(1);
@@ -413,7 +413,7 @@ public async Task FastPropertyGetterBuffer_ConsumeMatching_ShouldReturnCount()
await That(buffer.ConsumeMatching()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task FastPropertySetterBuffer_ConsumeMatching_ShouldHonorMatcher()
{
FastMockInteractions store = new(1);
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastEventBufferTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastEventBufferTests.cs
index a13b06180..544416ff9 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastEventBufferTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastEventBufferTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastEventBufferTests
{
- [Fact]
+ [Test]
public async Task EventSubscribe_RoutesThroughTypedBuffer()
{
IFastEventService sut = IFastEventService.CreateMock();
@@ -19,7 +19,7 @@ public async Task EventSubscribe_RoutesThroughTypedBuffer()
await That(buffer!.Count).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task EventUnsubscribe_RoutesThroughTypedBuffer()
{
IFastEventService sut = IFastEventService.CreateMock();
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastIndexerBufferTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastIndexerBufferTests.cs
index 17930e83f..25bf2e652 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastIndexerBufferTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastIndexerBufferTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastIndexerBufferTests
{
- [Fact]
+ [Test]
public async Task IndexerGet_RoutesThroughTypedBuffer()
{
IFastIndexerService sut = IFastIndexerService.CreateMock();
@@ -19,7 +19,7 @@ public async Task IndexerGet_RoutesThroughTypedBuffer()
await That(buffer!.Count).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerSet_RoutesThroughTypedBuffer()
{
IFastIndexerService sut = IFastIndexerService.CreateMock();
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastMockInteractionsTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastMockInteractionsTests.cs
index 5caff892d..d89608667 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastMockInteractionsTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastMockInteractionsTests.cs
@@ -9,7 +9,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastMockInteractionsTests
{
- [Fact]
+ [Test]
public async Task Append_ShouldRaiseInteractionAdded()
{
FastMockInteractions sut = new(1);
@@ -31,7 +31,7 @@ void Handler(object? sender, EventArgs e)
}
}
- [Fact]
+ [Test]
public async Task Buffers_ShouldExposeInstalledBuffersByMemberId()
{
FastMockInteractions sut = new(3);
@@ -46,7 +46,7 @@ public async Task Buffers_ShouldExposeInstalledBuffersByMemberId()
await That(sut.Buffers[2]).IsSameAs(subscribe);
}
- [Fact]
+ [Test]
public async Task Clear_FallbackPath_ShouldClearStrongReferencesInRecordsArray()
{
// Pins the `Array.Clear(_records, 0, _count);` call inside FallbackBuffer.Clear. With
@@ -79,7 +79,7 @@ public async Task Clear_FallbackPath_ShouldClearStrongReferencesInRecordsArray()
}
}
- [Fact]
+ [Test]
public async Task Clear_FallbackPath_ShouldNotResurfaceOldRecordsAfterRefill()
{
IMockInteractions sut = new FastMockInteractions(0);
@@ -106,7 +106,7 @@ public async Task Clear_FallbackPath_ShouldNotResurfaceOldRecordsAfterRefill()
await That(ordered[1]).IsSameAs(fourth);
}
- [Fact]
+ [Test]
public async Task Clear_ShouldFireOnClearing()
{
FastMockInteractions sut = new(1);
@@ -126,7 +126,7 @@ void Handler(object? sender, EventArgs e)
}
}
- [Fact]
+ [Test]
public async Task Clear_ShouldResetAllBuffersAndCount()
{
FastMockInteractions sut = new(2);
@@ -144,7 +144,7 @@ public async Task Clear_ShouldResetAllBuffersAndCount()
await That(sut.ToList()).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Clear_ShouldResetPerBufferVerifiedTracking()
{
FastMockInteractions sut = new(2);
@@ -164,7 +164,7 @@ public async Task Clear_ShouldResetPerBufferVerifiedTracking()
await That(sut.GetUnverifiedInteractions()).HasCount(2);
}
- [Fact]
+ [Test]
public async Task Clear_ShouldResetVerifiedBookkeeping()
{
FastMockInteractions sut = new(1);
@@ -181,7 +181,7 @@ public async Task Clear_ShouldResetVerifiedBookkeeping()
await That(unverified).HasCount(1);
}
- [Fact]
+ [Test]
public async Task Clear_WithSharedSingletonInVerifiedSet_ShouldResurfaceItAsUnverifiedAfterReAppend()
{
// Pins the `_verified = null;` reset inside Clear. FastPropertyGetterBuffer reuses a
@@ -203,7 +203,7 @@ public async Task Clear_WithSharedSingletonInVerifiedSet_ShouldResurfaceItAsUnve
await That(unverified).HasCount(1);
}
- [Fact]
+ [Test]
public async Task Count_ShouldReflectAppendsAcrossBuffers()
{
FastMockInteractions sut = new(2);
@@ -219,7 +219,7 @@ public async Task Count_ShouldReflectAppendsAcrossBuffers()
await That(getterBuffer.Count).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task GetEnumerator_ShouldReturnInteractionsInRegistrationOrder()
{
FastMockInteractions sut = new(2);
@@ -245,8 +245,8 @@ public async Task GetEnumerator_ShouldReturnInteractionsInRegistrationOrder()
await That(((PropertySetterAccess)ordered[3]).Value).IsEqualTo("y");
}
- [Fact]
- public async Task GetOrCreateFallbackBuffer_BarrierSynchronizedRace_AllCallersResolveToTheSameInstalledBuffer()
+ [Test]
+ public async Task GetOrCreateFallbackBuffer_BarrierSynchronizedRace_AllCallersResolveToTheSameInstalledBuffer(CancellationToken cancellationToken)
{
// Pins the `existing ?? created` null-coalesce in GetOrCreateFallbackBuffer. With the
// left side removed (`existing ?? created` → `created`), CompareExchange losers return
@@ -286,12 +286,6 @@ public async Task GetOrCreateFallbackBuffer_BarrierSynchronizedRace_AllCallersRe
}, TaskCreationOptions.LongRunning);
}
-#if NET48
- CancellationToken cancellationToken = TestContext.Current.CancellationToken;
-#else
- CancellationToken cancellationToken = CancellationToken.None;
-#endif
-
for (int round = 0; round < rounds; round++)
{
fallbackField.SetValue(sut, null);
@@ -309,7 +303,7 @@ public async Task GetOrCreateFallbackBuffer_BarrierSynchronizedRace_AllCallersRe
await Task.WhenAll(tasks);
}
- [Fact]
+ [Test]
public async Task GetOrCreateFallbackBuffer_ConcurrentRace_RecordsAllInteractions()
{
const int threads = 8;
@@ -340,7 +334,7 @@ public async Task GetOrCreateFallbackBuffer_ConcurrentRace_RecordsAllInteraction
await That(sut.ToList()).HasCount(threads * callsPerThread);
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_AcrossBuffersWithInterleavedAppends_ReturnsInSequenceOrder()
{
// Pins the `unverified.Count > 1` boundary that gates the defensive Sort by Seq inside
@@ -366,7 +360,7 @@ public async Task GetUnverifiedInteractions_AcrossBuffersWithInterleavedAppends_
await That(((MethodInvocation)unverified[3]).Parameter1).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_AcrossMultipleBuffers_ShouldUnionFastAndSlowVerifications()
{
FastMockInteractions sut = new(2);
@@ -382,7 +376,7 @@ public async Task GetUnverifiedInteractions_AcrossMultipleBuffers_ShouldUnionFas
await That(sut.GetUnverifiedInteractions()).IsEmpty();
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_AfterMatcherLessConsumeMatching_ShouldDropMarkedSlots()
{
FastMockInteractions sut = new(1);
@@ -401,7 +395,7 @@ public async Task GetUnverifiedInteractions_AfterMatcherLessConsumeMatching_Shou
await That(((MethodInvocation)unverified.Single()).Name).IsEqualTo("third");
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_AfterTypedConsumeMatching_ShouldDropOnlyMatchedSlots()
{
FastMockInteractions sut = new(1);
@@ -420,7 +414,7 @@ public async Task GetUnverifiedInteractions_AfterTypedConsumeMatching_ShouldDrop
await That(sut.GetUnverifiedInteractions()).IsEmpty();
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_FastPathPlusSlowPath_ShouldFilterByBoth()
{
FastMockInteractions sut = new(1);
@@ -439,7 +433,7 @@ public async Task GetUnverifiedInteractions_FastPathPlusSlowPath_ShouldFilterByB
await That(((MethodInvocation)unverified.Single()).Parameter1).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_ShouldRespectVerifiedSet()
{
FastMockInteractions sut = new(1);
@@ -457,7 +451,7 @@ public async Task GetUnverifiedInteractions_ShouldRespectVerifiedSet()
await That(unverified.Contains(all[1])).IsTrue();
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_WhenNothingRecorded_ShouldReturnArrayEmptySingleton()
{
FastMockInteractions sut = new(1);
@@ -470,7 +464,7 @@ await That(result).IsSameAs(Array.Empty())
"the empty path must take the `return Array.Empty();` early-return rather than fall through and allocate a fresh zero-length array");
}
- [Fact]
+ [Test]
public async Task GetUnverifiedInteractions_WhenNothingVerified_ShouldReturnEverything()
{
FastMockInteractions sut = new(1);
@@ -482,7 +476,7 @@ public async Task GetUnverifiedInteractions_WhenNothingVerified_ShouldReturnEver
await That(unverified).HasCount(1);
}
- [Fact]
+ [Test]
public async Task NextSequence_ShouldReturnZeroBasedMonotonicValues()
{
FastMockInteractions sut = new(0);
@@ -496,7 +490,7 @@ public async Task NextSequence_ShouldReturnZeroBasedMonotonicValues()
await That(third).IsEqualTo(2L);
}
- [Fact]
+ [Test]
public async Task RegisterInteraction_FallbackPath_GetUnverifiedInteractions_ShouldRespectVerifiedSet()
{
IMockInteractions sut = new FastMockInteractions(0);
@@ -514,7 +508,7 @@ public async Task RegisterInteraction_FallbackPath_GetUnverifiedInteractions_Sho
await That(unverified.Contains(second)).IsTrue();
}
- [Fact]
+ [Test]
public async Task RegisterInteraction_FallbackPath_OnClearing_ShouldFireWhenClearIsInvoked()
{
int invocations = 0;
@@ -535,7 +529,7 @@ void Handler(object? sender, EventArgs e)
}
}
- [Fact]
+ [Test]
public async Task RegisterInteraction_FallbackPath_ShouldEnumerateMultipleInRegistrationOrder()
{
IMockInteractions sut = new FastMockInteractions(0);
@@ -553,7 +547,7 @@ public async Task RegisterInteraction_FallbackPath_ShouldEnumerateMultipleInRegi
await That(enumerated[1]).IsSameAs(second);
}
- [Fact]
+ [Test]
public async Task RegisterInteraction_FallbackPath_ShouldFireInteractionAddedPerCall()
{
int invocations = 0;
@@ -573,7 +567,7 @@ void Handler(object? sender, EventArgs e)
}
}
- [Fact]
+ [Test]
public async Task RegisterInteraction_FallbackPath_ShouldRecordAndEnumerate()
{
IMockInteractions sut = new FastMockInteractions(0);
@@ -586,7 +580,7 @@ public async Task RegisterInteraction_FallbackPath_ShouldRecordAndEnumerate()
await That(sut.ToList()[0]).IsSameAs(interaction);
}
- [Fact]
+ [Test]
public async Task RegisterInteraction_WhenSkipInteractionRecording_ShouldNotRecord()
{
IMockInteractions sut = new FastMockInteractions(0, true);
@@ -596,7 +590,7 @@ public async Task RegisterInteraction_WhenSkipInteractionRecording_ShouldNotReco
await That(sut.Count).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task SkipInteractionRecording_ShouldReflectConstructionValue()
{
FastMockInteractions skipping = new(0, true);
@@ -606,7 +600,7 @@ public async Task SkipInteractionRecording_ShouldReflectConstructionValue()
await That(recording.SkipInteractionRecording).IsFalse();
}
- [Fact]
+ [Test]
public async Task Verified_BeforeAnyAppend_OnSecondCallAddsToExistingSet()
{
FastMockInteractions sut = new(1);
@@ -621,7 +615,7 @@ public async Task Verified_BeforeAnyAppend_OnSecondCallAddsToExistingSet()
await That(sut.GetUnverifiedInteractions()).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Verified_OnSecondCallWithDifferentItems_PreservesPreviouslyVerifiedItems()
{
// Pins the `_verified ??= []` lazy-init in Verified(). With the assignment turned into a
@@ -639,7 +633,7 @@ public async Task Verified_OnSecondCallWithDifferentItems_PreservesPreviouslyVer
await That(sut.GetUnverifiedInteractions()).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Verified_WithMultipleInteractions_AddsAllToInternalSet()
{
FastMockInteractions sut = new(1);
@@ -665,7 +659,7 @@ private static FastPropertyGetterBuffer InstallPropertyGetter(FastMockInteractio
public sealed class MethodBufferTests
{
- [Fact]
+ [Test]
public async Task Method0_BoxesAsMethodInvocation()
{
FastMockInteractions store = new(1);
@@ -677,7 +671,7 @@ public async Task Method0_BoxesAsMethodInvocation()
await That(boxed.Name).IsEqualTo("Foo");
}
- [Fact]
+ [Test]
public async Task Method1_BoxesAsMethodInvocationT1()
{
FastMockInteractions store = new(1);
@@ -690,7 +684,7 @@ public async Task Method1_BoxesAsMethodInvocationT1()
await That(boxed.Parameter1).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task Method2_BoxesAsMethodInvocationT1T2()
{
FastMockInteractions store = new(1);
@@ -704,7 +698,7 @@ public async Task Method2_BoxesAsMethodInvocationT1T2()
await That(boxed.Parameter2).IsEqualTo("bar");
}
- [Fact]
+ [Test]
public async Task Method3_BoxesAsMethodInvocationT1T2T3()
{
FastMockInteractions store = new(1);
@@ -719,7 +713,7 @@ public async Task Method3_BoxesAsMethodInvocationT1T2T3()
await That(boxed.Parameter3).IsTrue();
}
- [Fact]
+ [Test]
public async Task Method4_BoxesAsMethodInvocationT1T2T3T4()
{
FastMockInteractions store = new(1);
@@ -734,7 +728,7 @@ public async Task Method4_BoxesAsMethodInvocationT1T2T3T4()
await That(boxed.Parameter4).IsEqualTo(3.14);
}
- [Fact]
+ [Test]
public async Task ResizesAndPreservesOrder()
{
FastMockInteractions store = new(1);
@@ -756,7 +750,7 @@ public async Task ResizesAndPreservesOrder()
public sealed class PropertyBufferTests
{
- [Fact]
+ [Test]
public async Task Getter_BoxesAsPropertyGetterAccess()
{
FastMockInteractions store = new(1);
@@ -769,7 +763,7 @@ public async Task Getter_BoxesAsPropertyGetterAccess()
await That(boxed.Name).IsEqualTo("Foo");
}
- [Fact]
+ [Test]
public async Task Setter_BoxesAsPropertySetterAccessT()
{
FastMockInteractions store = new(1);
@@ -786,7 +780,7 @@ public async Task Setter_BoxesAsPropertySetterAccessT()
public sealed class IndexerBufferTests
{
- [Fact]
+ [Test]
public async Task Getter1_BoxesAsIndexerGetterAccess()
{
FastMockInteractions store = new(1);
@@ -799,7 +793,7 @@ public async Task Getter1_BoxesAsIndexerGetterAccess()
await That(boxed.Parameter1).IsEqualTo("k");
}
- [Fact]
+ [Test]
public async Task Getter2_BoxesAsIndexerGetterAccess()
{
FastMockInteractions store = new(1);
@@ -813,7 +807,7 @@ public async Task Getter2_BoxesAsIndexerGetterAccess()
await That(boxed.Parameter2).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task Setter1_BoxesAsIndexerSetterAccess()
{
FastMockInteractions store = new(1);
@@ -827,7 +821,7 @@ public async Task Setter1_BoxesAsIndexerSetterAccess()
await That(boxed.TypedValue).IsTrue();
}
- [Fact]
+ [Test]
public async Task Setter2_BoxesAsIndexerSetterAccess()
{
FastMockInteractions store = new(1);
@@ -844,7 +838,7 @@ public async Task Setter2_BoxesAsIndexerSetterAccess()
public sealed class EventBufferTests
{
- [Fact]
+ [Test]
public async Task Subscribe_BoxesAsEventSubscription()
{
FastMockInteractions store = new(1);
@@ -860,7 +854,7 @@ public async Task Subscribe_BoxesAsEventSubscription()
await That(boxed.Method).IsSameAs(method);
}
- [Fact]
+ [Test]
public async Task Unsubscribe_BoxesAsEventUnsubscription()
{
FastMockInteractions store = new(1);
@@ -877,7 +871,7 @@ public async Task Unsubscribe_BoxesAsEventUnsubscription()
public sealed class ConcurrencyTests
{
- [Fact]
+ [Test]
public async Task ConcurrentAppendsAcrossMembers_ShouldPreserveTotalCount()
{
const int threads = 8;
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/FastPropertyBufferTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/FastPropertyBufferTests.cs
index 71d810e53..e1b236be2 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/FastPropertyBufferTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/FastPropertyBufferTests.cs
@@ -5,7 +5,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public class FastPropertyBufferTests
{
- [Fact]
+ [Test]
public async Task PropertyGet_BufferRecordsArePreservedOnEnumeration()
{
IFastPropertyService sut = IFastPropertyService.CreateMock();
@@ -22,7 +22,7 @@ public async Task PropertyGet_BufferRecordsArePreservedOnEnumeration()
await That(all[2]).IsExactly();
}
- [Fact]
+ [Test]
public async Task PropertyGet_RoutesThroughTypedBuffer()
{
IFastPropertyService sut = IFastPropertyService.CreateMock();
@@ -39,7 +39,7 @@ public async Task PropertyGet_RoutesThroughTypedBuffer()
await That(fast.Count).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task PropertySet_RoutesThroughTypedBuffer()
{
IFastPropertyService sut = IFastPropertyService.CreateMock();
@@ -55,7 +55,7 @@ public async Task PropertySet_RoutesThroughTypedBuffer()
await That(buffer!.Count).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task SkipInteractionRecording_DoesNotAppendToBuffer()
{
MockBehavior behavior = MockBehavior.Default with
diff --git a/Tests/Mockolate.Internal.Tests/Interactions/IndexerAccessTests.cs b/Tests/Mockolate.Internal.Tests/Interactions/IndexerAccessTests.cs
index fb50f4671..010c1270c 100644
--- a/Tests/Mockolate.Internal.Tests/Interactions/IndexerAccessTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Interactions/IndexerAccessTests.cs
@@ -6,7 +6,7 @@ namespace Mockolate.Internal.Tests.Interactions;
public sealed class IndexerAccessTests
{
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerGetterAccess1_UsesGetOrAddChildDispatch()
{
RecordingStorage storage = new();
@@ -20,7 +20,7 @@ public async Task StoreValue_OnIndexerGetterAccess1_UsesGetOrAddChildDispatch()
await That(storage.Calls).IsEqualTo(["GetOrAdd(42)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerGetterAccess2_UsesGetOrAddChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -34,7 +34,7 @@ public async Task StoreValue_OnIndexerGetterAccess2_UsesGetOrAddChildDispatchFor
await That(storage.Calls).IsEqualTo(["GetOrAdd(1)", "GetOrAdd(2)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerGetterAccess3_UsesGetOrAddChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -48,7 +48,7 @@ public async Task StoreValue_OnIndexerGetterAccess3_UsesGetOrAddChildDispatchFor
await That(storage.Calls).IsEqualTo(["GetOrAdd(1)", "GetOrAdd(2)", "GetOrAdd(3)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerGetterAccess4_UsesGetOrAddChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -63,7 +63,7 @@ public async Task StoreValue_OnIndexerGetterAccess4_UsesGetOrAddChildDispatchFor
await That(storage.Calls).IsEqualTo(["GetOrAdd(1)", "GetOrAdd(2)", "GetOrAdd(3)", "GetOrAdd(4)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerSetterAccess1_UsesGetOrAddChildDispatch()
{
RecordingStorage storage = new();
@@ -77,7 +77,7 @@ public async Task StoreValue_OnIndexerSetterAccess1_UsesGetOrAddChildDispatch()
await That(storage.Calls).IsEqualTo(["GetOrAdd(42)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerSetterAccess2_UsesGetOrAddChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -92,7 +92,7 @@ public async Task StoreValue_OnIndexerSetterAccess2_UsesGetOrAddChildDispatchFor
await That(storage.Calls).IsEqualTo(["GetOrAdd(1)", "GetOrAdd(2)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerSetterAccess3_UsesGetOrAddChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -107,7 +107,7 @@ public async Task StoreValue_OnIndexerSetterAccess3_UsesGetOrAddChildDispatchFor
await That(storage.Calls).IsEqualTo(["GetOrAdd(1)", "GetOrAdd(2)", "GetOrAdd(3)",]);
}
- [Fact]
+ [Test]
public async Task StoreValue_OnIndexerSetterAccess4_UsesGetOrAddChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -122,7 +122,7 @@ public async Task StoreValue_OnIndexerSetterAccess4_UsesGetOrAddChildDispatchFor
await That(storage.Calls).IsEqualTo(["GetOrAdd(1)", "GetOrAdd(2)", "GetOrAdd(3)", "GetOrAdd(4)",]);
}
- [Fact]
+ [Test]
public async Task ToString_OnIndexerGetterAccess3_FormatsEachNullParameterAsNullLiteral()
{
IndexerGetterAccess access = new(null, null, null);
@@ -132,7 +132,7 @@ await That(access.ToString()).IsEqualTo("get indexer [null, null, null]")
"each `?? \"null\"` literal in IndexerGetterAccess.ToString must render a null parameter as `null` rather than as an empty slot like \"[, ...]\"");
}
- [Fact]
+ [Test]
public async Task ToString_OnIndexerGetterAccess4_FormatsEachNullParameterAsNullLiteral()
{
IndexerGetterAccess access =
@@ -141,7 +141,7 @@ public async Task ToString_OnIndexerGetterAccess4_FormatsEachNullParameterAsNull
await That(access.ToString()).IsEqualTo("get indexer [null, null, null, null]");
}
- [Fact]
+ [Test]
public async Task ToString_OnIndexerSetterAccess3_FormatsEachNullParameterAsNullLiteral()
{
IndexerSetterAccess access = new(null, null, null, null);
@@ -149,7 +149,7 @@ public async Task ToString_OnIndexerSetterAccess3_FormatsEachNullParameterAsNull
await That(access.ToString()).IsEqualTo("set indexer [null, null, null] to null");
}
- [Fact]
+ [Test]
public async Task ToString_OnIndexerSetterAccess4_FormatsEachNullParameterAsNullLiteral()
{
IndexerSetterAccess access =
@@ -158,7 +158,7 @@ public async Task ToString_OnIndexerSetterAccess4_FormatsEachNullParameterAsNull
await That(access.ToString()).IsEqualTo("set indexer [null, null, null, null] to null");
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess1_UsesGetChildDispatch()
{
RecordingStorage storage = new();
@@ -172,7 +172,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess1_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(42)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess1_WithoutStorage_ShouldReturnFalse()
{
IndexerGetterAccess access = new(42);
@@ -184,7 +184,7 @@ await That(found).IsFalse()
"the first `if (s is null) { return null; }` guard in IndexerGetterAccess.TraverseStorage must short-circuit instead of dereferencing null to call GetChildDispatch");
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess2_UsesGetChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -198,7 +198,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess2_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(1)", "Get(2)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess2_WithoutStorage_ShouldReturnFalse()
{
IndexerGetterAccess access = new(1, 2);
@@ -208,7 +208,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess2_WithoutStorage_Shoul
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess3_UsesGetChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -222,7 +222,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess3_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(1)", "Get(2)", "Get(3)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess3_WithoutStorage_ShouldReturnFalse()
{
IndexerGetterAccess access = new(1, 2, 3);
@@ -232,7 +232,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess3_WithoutStorage_Shoul
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess4_UsesGetChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -247,7 +247,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess4_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(1)", "Get(2)", "Get(3)", "Get(4)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerGetterAccess4_WithoutStorage_ShouldReturnFalse()
{
IndexerGetterAccess access = new(1, 2, 3, 4);
@@ -257,7 +257,7 @@ public async Task TryFindStoredValue_OnIndexerGetterAccess4_WithoutStorage_Shoul
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess1_UsesGetChildDispatch()
{
RecordingStorage storage = new();
@@ -271,7 +271,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess1_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(42)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess1_WithoutStorage_ShouldReturnFalse()
{
IndexerSetterAccess access = new(42, "v");
@@ -281,7 +281,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess1_WithoutStorage_Shoul
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess2_UsesGetChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -296,7 +296,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess2_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(1)", "Get(2)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess2_WhenFirstDispatchReturnsNull_ShouldReturnFalse()
{
// Pins the second `if (s is null) { return null; }` guard inside
@@ -314,7 +314,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess2_WhenFirstDispatchRet
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess2_WithoutStorage_ShouldReturnFalse()
{
IndexerSetterAccess access = new(1, 2, "v");
@@ -324,7 +324,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess2_WithoutStorage_Shoul
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess3_UsesGetChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -339,7 +339,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess3_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(1)", "Get(2)", "Get(3)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess3_WhenFirstDispatchReturnsNull_ShouldReturnFalse()
{
NullAfterStorage storage = new(1);
@@ -353,7 +353,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess3_WhenFirstDispatchRet
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess3_WhenSecondDispatchReturnsNull_ShouldReturnFalse()
{
NullAfterStorage storage = new(2);
@@ -367,7 +367,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess3_WhenSecondDispatchRe
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess3_WithoutStorage_ShouldReturnFalse()
{
IndexerSetterAccess access = new(1, 2, 3, "v");
@@ -377,7 +377,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess3_WithoutStorage_Shoul
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess4_UsesGetChildDispatchForEachParameter()
{
RecordingStorage storage = new();
@@ -392,7 +392,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess4_UsesGetChildDispatch
await That(storage.Calls).IsEqualTo(["Get(1)", "Get(2)", "Get(3)", "Get(4)",]);
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess4_WhenFirstDispatchReturnsNull_ShouldReturnFalse()
{
NullAfterStorage storage = new(1);
@@ -406,7 +406,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess4_WhenFirstDispatchRet
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess4_WhenSecondDispatchReturnsNull_ShouldReturnFalse()
{
NullAfterStorage storage = new(2);
@@ -420,7 +420,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess4_WhenSecondDispatchRe
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess4_WhenThirdDispatchReturnsNull_ShouldReturnFalse()
{
NullAfterStorage storage = new(3);
@@ -434,7 +434,7 @@ public async Task TryFindStoredValue_OnIndexerSetterAccess4_WhenThirdDispatchRet
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryFindStoredValue_OnIndexerSetterAccess4_WithoutStorage_ShouldReturnFalse()
{
IndexerSetterAccess access = new(1, 2, 3, 4, "v");
diff --git a/Tests/Mockolate.Internal.Tests/Internals/StringExtensionsTests.cs b/Tests/Mockolate.Internal.Tests/Internals/StringExtensionsTests.cs
index 005a46591..78a51cf56 100644
--- a/Tests/Mockolate.Internal.Tests/Internals/StringExtensionsTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Internals/StringExtensionsTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.Internal.Tests.Internals;
public sealed class StringExtensionsTests
{
- [Fact]
+ [Test]
public async Task SubstringAfterLast_WhenNameContainsMultipleDots_ShouldUseLastOccurrence()
{
string value = "foo.bar.baz";
@@ -14,7 +14,7 @@ public async Task SubstringAfterLast_WhenNameContainsMultipleDots_ShouldUseLastO
await That(result).IsEqualTo("baz");
}
- [Fact]
+ [Test]
public async Task SubstringAfterLast_WhenNameDoesNotContainAnyDots_ShouldReturnFullString()
{
string value = "foo-bar";
@@ -24,7 +24,7 @@ public async Task SubstringAfterLast_WhenNameDoesNotContainAnyDots_ShouldReturnF
await That(result).IsEqualTo("foo-bar");
}
- [Fact]
+ [Test]
public async Task SubstringAfterLast_WhenNameEndsWithDot_ShouldReturnEmptyString()
{
string value = "foo.";
@@ -34,7 +34,7 @@ public async Task SubstringAfterLast_WhenNameEndsWithDot_ShouldReturnEmptyString
await That(result).IsEqualTo("");
}
- [Fact]
+ [Test]
public async Task SubstringUntilFirst_WhenNameContainsMultipleDots_ShouldUseFirstOccurrence()
{
string value = "foo.bar.baz";
@@ -44,7 +44,7 @@ public async Task SubstringUntilFirst_WhenNameContainsMultipleDots_ShouldUseFirs
await That(result).IsEqualTo("foo");
}
- [Fact]
+ [Test]
public async Task SubstringUntilFirst_WhenNameDoesNotContainAnyDots_ShouldReturnFullString()
{
string value = "foo-bar";
@@ -54,7 +54,7 @@ public async Task SubstringUntilFirst_WhenNameDoesNotContainAnyDots_ShouldReturn
await That(result).IsEqualTo("foo-bar");
}
- [Fact]
+ [Test]
public async Task SubstringUntilFirst_WhenNameStartsWithDot_ShouldReturnEmptyString()
{
string value = ".foo";
diff --git a/Tests/Mockolate.Internal.Tests/Internals/TypeFormatterTests.cs b/Tests/Mockolate.Internal.Tests/Internals/TypeFormatterTests.cs
index 313ee16f8..e4d0b8159 100644
--- a/Tests/Mockolate.Internal.Tests/Internals/TypeFormatterTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Internals/TypeFormatterTests.cs
@@ -6,7 +6,7 @@ namespace Mockolate.Internal.Tests.Internals;
public sealed class TypeFormatterTests
{
- [Fact]
+ [Test]
public async Task GenericArguments_ShouldFormatToName()
{
MethodInfo methodInfo = GetType().GetMethod(nameof(MyMethod), BindingFlags.NonPublic | BindingFlags.Static)!;
@@ -17,7 +17,7 @@ public async Task GenericArguments_ShouldFormatToName()
await That(result).IsEqualTo("T");
}
- [Fact]
+ [Test]
public async Task NestedType_ShouldIncludeDeclaringType()
{
Type type = typeof(MyType);
@@ -27,7 +27,7 @@ public async Task NestedType_ShouldIncludeDeclaringType()
await That(result).IsEqualTo("TypeFormatterTests.MyType");
}
- [Fact]
+ [Test]
public async Task ShouldFormatVoid()
{
MethodInfo methodInfo = GetType().GetMethod(nameof(MyMethod), BindingFlags.NonPublic | BindingFlags.Static)!;
diff --git a/Tests/Mockolate.Internal.Tests/Internals/WildcardTests.cs b/Tests/Mockolate.Internal.Tests/Internals/WildcardTests.cs
index 05a793c3b..239b57292 100644
--- a/Tests/Mockolate.Internal.Tests/Internals/WildcardTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Internals/WildcardTests.cs
@@ -4,10 +4,10 @@ namespace Mockolate.Internal.Tests.Internals;
public class WildcardTests
{
- [Theory]
- [InlineData("\r\n")]
- [InlineData("\r")]
- [InlineData("\n")]
+ [Test]
+ [Arguments("\r\n")]
+ [Arguments("\r")]
+ [Arguments("\n")]
public async Task ShouldSupportMultilineStrings(string newlineSeparator)
{
Wildcard wildcard = Wildcard.Pattern("fo*az", false);
diff --git a/Tests/Mockolate.Internal.Tests/Parameters/ParameterMatchAdapterTests.cs b/Tests/Mockolate.Internal.Tests/Parameters/ParameterMatchAdapterTests.cs
index 7b1108f3e..4d2fd5c5b 100644
--- a/Tests/Mockolate.Internal.Tests/Parameters/ParameterMatchAdapterTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Parameters/ParameterMatchAdapterTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.Internal.Tests.Parameters;
public class ParameterMatchAdapterTests
{
- [Fact]
+ [Test]
public async Task ParameterMatch_FallsBackToBoxedMatchesCall()
{
IParameter match = IParameter.CreateMock();
@@ -20,7 +20,7 @@ void Act()
await That(Act).Throws().WithMessage("Matches(object) is called");
}
- [Fact]
+ [Test]
public async Task ParameterMatch_PrefersUnboxedMatchesCall()
{
IParameter match = IParameter.CreateMock().Implementing>();
diff --git a/Tests/Mockolate.Internal.Tests/RefStructProjectionStorageTests.cs b/Tests/Mockolate.Internal.Tests/RefStructProjectionStorageTests.cs
index b9694e492..8487d4b69 100644
--- a/Tests/Mockolate.Internal.Tests/RefStructProjectionStorageTests.cs
+++ b/Tests/Mockolate.Internal.Tests/RefStructProjectionStorageTests.cs
@@ -22,7 +22,7 @@ private readonly ref struct Key(int id)
public int Id { get; } = id;
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithProjection_StoreAndTryGet_RoundTrip()
{
IParameter matcher = It.IsRefStructBy(k => k.Id);
@@ -37,7 +37,7 @@ public async Task GetterSetup_WithProjection_StoreAndTryGet_RoundTrip()
await That(value).IsEqualTo("forty-two");
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithoutProjection_StoreIsNoOp_TryGetReturnsFalse()
{
IParameter matcher = It.IsAnyRefStruct();
@@ -51,7 +51,7 @@ public async Task GetterSetup_WithoutProjection_StoreIsNoOp_TryGetReturnsFalse()
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task GetterSetup_NullMatcher_HasNoStorage()
{
RefStructIndexerGetterSetup getter = new("get_Item", null);
@@ -63,7 +63,7 @@ public async Task GetterSetup_NullMatcher_HasNoStorage()
await That(found).IsFalse();
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithProjectionAndPredicate_StoreSkipsNonMatchingKey()
{
IParameter matcher = It.IsRefStructBy(k => k.Id, id => id > 10);
@@ -81,7 +81,7 @@ public async Task GetterSetup_WithProjectionAndPredicate_StoreSkipsNonMatchingKe
await That(bigValue).IsEqualTo("big");
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithProjection_Invoke_ReturnsStoredValue_BeforeReturnFactory()
{
IRefStructIndexerGetterSetup setup;
@@ -98,7 +98,7 @@ public async Task GetterSetup_WithProjection_Invoke_ReturnsStoredValue_BeforeRet
await That(read).IsEqualTo("stored");
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithProjection_EmptyBucket_Invoke_FallsBackToReturns()
{
IRefStructIndexerGetterSetup setup;
@@ -113,7 +113,7 @@ public async Task GetterSetup_WithProjection_EmptyBucket_Invoke_FallsBackToRetur
await That(read).IsEqualTo("fallback");
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithProjection_HasReturnValue_IsTrueEvenWithoutReturnFactory()
{
RefStructIndexerGetterSetup getter = new(
@@ -125,7 +125,7 @@ await That(getter.HasReturnValue).IsTrue()
"activating the storage dictionary must flip HasReturnValue, so that the generator's emitted getter body takes the return path and serves stored values");
}
- [Fact]
+ [Test]
public async Task GetterSetup_WithoutProjection_HasReturnValue_IsFalse_UntilReturnsConfigured()
{
RefStructIndexerGetterSetup getter = new(
@@ -138,7 +138,7 @@ public async Task GetterSetup_WithoutProjection_HasReturnValue_IsFalse_UntilRetu
await That(getter.HasReturnValue).IsTrue();
}
- [Fact]
+ [Test]
public async Task CombinedSetup_Constructor_WiresSetterBoundGetter()
{
IParameter matcher = It.IsRefStructBy(k => k.Id);
@@ -148,7 +148,7 @@ public async Task CombinedSetup_Constructor_WiresSetterBoundGetter()
await That(setup.Setter.BoundGetter).IsSameAs(setup.Getter);
}
- [Fact]
+ [Test]
public async Task CombinedSetup_WithProjection_SetterInvoke_StoresIntoGetter()
{
IParameter matcher = It.IsRefStructBy(k => k.Id);
@@ -163,7 +163,7 @@ public async Task CombinedSetup_WithProjection_SetterInvoke_StoresIntoGetter()
await That(value).IsEqualTo("seven");
}
- [Fact]
+ [Test]
public async Task SetterOnlySetup_BoundGetter_DefaultsToNull_InvokeIsStorageNoOp()
{
IParameter matcher = It.IsRefStructBy(k => k.Id);
@@ -177,7 +177,7 @@ public async Task SetterOnlySetup_BoundGetter_DefaultsToNull_InvokeIsStorageNoOp
setter.Invoke(new Key(7), "seven");
}
- [Fact]
+ [Test]
public async Task CombinedSetup_WithoutProjection_NoStorageActivated()
{
IParameter matcher = It.IsAnyRefStruct();
@@ -196,7 +196,7 @@ await That(found).IsFalse()
public sealed class Arity2Tests
{
- [Fact]
+ [Test]
public async Task AllProjections_StoreAndTryGet_RoundTrip()
{
IParameter p1 = It.IsRefStructBy(k => k.Id);
@@ -214,7 +214,7 @@ public async Task AllProjections_StoreAndTryGet_RoundTrip()
await That(miss).IsFalse();
}
- [Fact]
+ [Test]
public async Task MixedNormalAndProjection_StoreAndTryGet_RoundTrip()
{
IParameter normal = It.IsAny();
@@ -234,7 +234,7 @@ public async Task MixedNormalAndProjection_StoreAndTryGet_RoundTrip()
await That(missOnSecond).IsFalse();
}
- [Fact]
+ [Test]
public async Task OneRefStructWithoutProjection_StorageInactive()
{
IParameter normal = It.IsAny();
@@ -250,7 +250,7 @@ public async Task OneRefStructWithoutProjection_StorageInactive()
await That(getter.HasReturnValue).IsFalse();
}
- [Fact]
+ [Test]
public async Task CombinedSetup_WiresBoundGetter_SetterWrite_FeedsGetterRead()
{
IParameter normal = It.IsAny();
@@ -271,7 +271,7 @@ public async Task CombinedSetup_WiresBoundGetter_SetterWrite_FeedsGetterRead()
public sealed class Arity3Tests
{
- [Fact]
+ [Test]
public async Task MixedProjectionAndNormal_RoundTrip()
{
IParameter p1 = It.IsAny();
@@ -293,7 +293,7 @@ public async Task MixedProjectionAndNormal_RoundTrip()
public sealed class Arity4Tests
{
- [Fact]
+ [Test]
public async Task AllRefStructWithProjection_RoundTrip()
{
IParameter p = It.IsRefStructBy(k => k.Id);
diff --git a/Tests/Mockolate.Internal.Tests/Registry/MockRegistryScenarioTests.cs b/Tests/Mockolate.Internal.Tests/Registry/MockRegistryScenarioTests.cs
index 7c7efa5e2..17e161bb1 100644
--- a/Tests/Mockolate.Internal.Tests/Registry/MockRegistryScenarioTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Registry/MockRegistryScenarioTests.cs
@@ -8,7 +8,7 @@ namespace Mockolate.Internal.Tests.Registry;
public sealed class MockRegistryScenarioTests
{
- [Fact]
+ [Test]
public async Task ApplyIndexerGetter_WithLazyDefault_AndNonNullSetup_DispatchesToSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -23,7 +23,7 @@ await That(result).IsEqualTo(1)
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task GetIndexerSetup_ByAccess_WithActiveScenarioAndScopedMatching_ReturnsScoped()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -39,7 +39,7 @@ public async Task GetIndexerSetup_ByAccess_WithActiveScenarioAndScopedMatching_R
await That(result).IsSameAs(scoped);
}
- [Fact]
+ [Test]
public async Task GetIndexerSetup_ByAccess_WithActiveScenarioButScopedDoesNotMatchAccess_FallsBackToGlobal()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -55,7 +55,7 @@ public async Task GetIndexerSetup_ByAccess_WithActiveScenarioButScopedDoesNotMat
await That(result).IsSameAs(global);
}
- [Fact]
+ [Test]
public async Task GetIndexerSetup_ByPredicate_WithActiveScenarioButPredicateRejectsScoped_FallsBackToGlobal()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -71,7 +71,7 @@ public async Task GetIndexerSetup_ByPredicate_WithActiveScenarioButPredicateReje
await That(result).IsSameAs(global);
}
- [Fact]
+ [Test]
public async Task GetMethodSetups_WithActiveScenarioAndScopedSetup_YieldsScopedThenGlobal()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -89,7 +89,7 @@ public async Task GetMethodSetups_WithActiveScenarioAndScopedSetup_YieldsScopedT
await That(setups[1]).IsSameAs(global);
}
- [Fact]
+ [Test]
public async Task GetMethodSetups_WithActiveScenarioButNoScopedBucket_FallsBackToGlobal()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
diff --git a/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySetupSnapshotTests.cs b/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySetupSnapshotTests.cs
index 1179dc977..6b532ca2d 100644
--- a/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySetupSnapshotTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySetupSnapshotTests.cs
@@ -16,7 +16,7 @@ public sealed class MockRegistrySetupSnapshotTests
public sealed class MethodTests
{
- [Fact]
+ [Test]
public async Task SetupMethod_WithIncreasingMemberIds_GrowsTableLazily()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -39,7 +39,7 @@ public async Task SetupMethod_WithIncreasingMemberIds_GrowsTableLazily()
await That(snapshot3![0]).IsSameAs(setup3);
}
- [Fact]
+ [Test]
public async Task SetupMethod_WithMemberId_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -53,7 +53,7 @@ public async Task SetupMethod_WithMemberId_PublishesToSnapshot()
await That(snapshot[0]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupMethod_WithMemberIdAndDefaultScenario_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -67,7 +67,7 @@ public async Task SetupMethod_WithMemberIdAndDefaultScenario_PublishesToSnapshot
await That(snapshot[0]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupMethod_WithMemberIdAndNamedScenario_DoesNotPublishToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -78,7 +78,7 @@ public async Task SetupMethod_WithMemberIdAndNamedScenario_DoesNotPublishToSnaps
await That(registry.GetMethodSetupSnapshot(5)).IsNull();
}
- [Fact]
+ [Test]
public async Task SetupMethod_WithMemberIdAndNamedScenario_PreservesScenarioBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -91,7 +91,7 @@ public async Task SetupMethod_WithMemberIdAndNamedScenario_PreservesScenarioBuck
await That(scoped!.Methods.Count).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task SetupMethod_WithSameMemberIdTwice_AppendsToBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -111,7 +111,7 @@ public async Task SetupMethod_WithSameMemberIdTwice_AppendsToBucket()
public sealed class PropertyTests
{
- [Fact]
+ [Test]
public async Task PublishPropertyToMemberIdBucket_WhenResized_PreservesEarlierEntries()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -127,7 +127,7 @@ public async Task PublishPropertyToMemberIdBucket_WhenResized_PreservesEarlierEn
await That(registry.GetPropertySetupSnapshot(10)).IsSameAs(setupHigh);
}
- [Fact]
+ [Test]
public async Task PublishPropertyToMemberIdBucket_WithDefaultThenDefault_OverwritesInSnapshotTable()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -141,7 +141,7 @@ public async Task PublishPropertyToMemberIdBucket_WithDefaultThenDefault_Overwri
await That(snapshot).IsSameAs(defaultB);
}
- [Fact]
+ [Test]
public async Task PublishPropertyToMemberIdBucket_WithDefaultThenUserSetup_RetainsUserSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -157,7 +157,7 @@ public async Task PublishPropertyToMemberIdBucket_WithDefaultThenUserSetup_Retai
await That(observed).IsEqualTo(99);
}
- [Fact]
+ [Test]
public async Task PublishPropertyToMemberIdBucket_WithUserThenDefault_RetainsUserSetupInSnapshotTable()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -171,7 +171,7 @@ public async Task PublishPropertyToMemberIdBucket_WithUserThenDefault_RetainsUse
await That(snapshot).IsSameAs(userSetup);
}
- [Fact]
+ [Test]
public async Task PublishPropertyToMemberIdBucket_WithUserThenDefaultSetup_RetainsUserSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -185,7 +185,7 @@ public async Task PublishPropertyToMemberIdBucket_WithUserThenDefaultSetup_Retai
await That(observed).IsEqualTo(99);
}
- [Fact]
+ [Test]
public async Task SetupProperty_DefaultDoesNotOverwriteUserSetupAtSameMemberIdInSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -200,7 +200,7 @@ public async Task SetupProperty_DefaultDoesNotOverwriteUserSetupAtSameMemberIdIn
await That(table![1]).IsSameAs(userSetup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_UserSetupDoesOverwriteDefaultAtSameMemberIdInSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -216,7 +216,7 @@ public async Task SetupProperty_UserSetupDoesOverwriteDefaultAtSameMemberIdInSna
await That(table![1]).IsSameAs(userSetup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithGrowingMemberIds_PreservesEarlierEntriesViaArrayCopy()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -235,7 +235,7 @@ public async Task SetupProperty_WithGrowingMemberIds_PreservesEarlierEntriesViaA
await That(table[5]).IsSameAs(setupB);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithIncreasingMemberIds_GrowsTableLazily()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -255,7 +255,7 @@ public async Task SetupProperty_WithIncreasingMemberIds_GrowsTableLazily()
await That(registry.GetPropertyFast(3, new PropertyGetterAccess("P3"), _ => -1)).IsEqualTo(30);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberId_PopulatesSnapshotSlot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -270,7 +270,7 @@ public async Task SetupProperty_WithMemberId_PopulatesSnapshotSlot()
await That(table[3]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberId_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -283,7 +283,7 @@ public async Task SetupProperty_WithMemberId_PublishesToSnapshot()
await That(observed).IsEqualTo(50);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberId_PublishesUserSetupToSnapshotTable()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -296,7 +296,7 @@ public async Task SetupProperty_WithMemberId_PublishesUserSetupToSnapshotTable()
await That(snapshot).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberIdAndDefaultScenario_PopulatesSnapshotSlot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -310,7 +310,7 @@ public async Task SetupProperty_WithMemberIdAndDefaultScenario_PopulatesSnapshot
await That(table![3]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberIdAndDefaultScenario_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -323,7 +323,7 @@ public async Task SetupProperty_WithMemberIdAndDefaultScenario_PublishesToSnapsh
await That(observed).IsEqualTo(50);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberIdAndDefaultScenario_PublishesUserSetupToSnapshotTable()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -336,7 +336,7 @@ public async Task SetupProperty_WithMemberIdAndDefaultScenario_PublishesUserSetu
await That(snapshot).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberIdAndNamedScenario_DoesNotPublishToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -349,7 +349,7 @@ public async Task SetupProperty_WithMemberIdAndNamedScenario_DoesNotPublishToSna
await That(observed).IsEqualTo(-1);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberIdAndNamedScenario_LeavesSnapshotUnpublished()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -362,7 +362,7 @@ public async Task SetupProperty_WithMemberIdAndNamedScenario_LeavesSnapshotUnpub
await That(table).IsNull();
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithMemberIdAndNamedScenario_PreservesScenarioBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -375,7 +375,7 @@ public async Task SetupProperty_WithMemberIdAndNamedScenario_PreservesScenarioBu
await That(scopedSetup).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupProperty_WithSameMemberIdTwice_RetainsLatestUserSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -394,7 +394,7 @@ public async Task SetupProperty_WithSameMemberIdTwice_RetainsLatestUserSetup()
public sealed class IndexerTests
{
- [Fact]
+ [Test]
public async Task SetupIndexer_WithIncreasingMemberIds_GrowsTableLazily()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -417,7 +417,7 @@ public async Task SetupIndexer_WithIncreasingMemberIds_GrowsTableLazily()
await That(snapshot3![0]).IsSameAs(setup3);
}
- [Fact]
+ [Test]
public async Task SetupIndexer_WithMemberId_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -431,7 +431,7 @@ public async Task SetupIndexer_WithMemberId_PublishesToSnapshot()
await That(snapshot[0]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupIndexer_WithMemberIdAndDefaultScenario_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -445,7 +445,7 @@ public async Task SetupIndexer_WithMemberIdAndDefaultScenario_PublishesToSnapsho
await That(snapshot[0]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupIndexer_WithMemberIdAndNamedScenario_DoesNotPublishToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -456,7 +456,7 @@ public async Task SetupIndexer_WithMemberIdAndNamedScenario_DoesNotPublishToSnap
await That(registry.GetIndexerSetupSnapshot(5)).IsNull();
}
- [Fact]
+ [Test]
public async Task SetupIndexer_WithMemberIdAndNamedScenario_PreservesScenarioBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -469,7 +469,7 @@ public async Task SetupIndexer_WithMemberIdAndNamedScenario_PreservesScenarioBuc
await That(scoped!.Indexers.Count).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task SetupIndexer_WithSameMemberIdTwice_AppendsToBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -489,7 +489,7 @@ public async Task SetupIndexer_WithSameMemberIdTwice_AppendsToBucket()
public sealed class EventTests
{
- [Fact]
+ [Test]
public async Task SetupEvent_WithIncreasingMemberIds_GrowsTableLazily()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -512,7 +512,7 @@ public async Task SetupEvent_WithIncreasingMemberIds_GrowsTableLazily()
await That(snapshot3![0]).IsSameAs(setup3);
}
- [Fact]
+ [Test]
public async Task SetupEvent_WithMemberId_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -526,7 +526,7 @@ public async Task SetupEvent_WithMemberId_PublishesToSnapshot()
await That(snapshot[0]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupEvent_WithMemberIdAndDefaultScenario_PublishesToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -540,7 +540,7 @@ public async Task SetupEvent_WithMemberIdAndDefaultScenario_PublishesToSnapshot(
await That(snapshot[0]).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task SetupEvent_WithMemberIdAndNamedScenario_DoesNotPublishToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -551,7 +551,7 @@ public async Task SetupEvent_WithMemberIdAndNamedScenario_DoesNotPublishToSnapsh
await That(registry.GetEventSetupSnapshot(5)).IsNull();
}
- [Fact]
+ [Test]
public async Task SetupEvent_WithMemberIdAndNamedScenario_PreservesScenarioBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -564,7 +564,7 @@ public async Task SetupEvent_WithMemberIdAndNamedScenario_PreservesScenarioBucke
await That(scoped!.Events.Count).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task SetupEvent_WithSameMemberIdTwice_AppendsToBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
diff --git a/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySnapshotRetrievalTests.cs b/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySnapshotRetrievalTests.cs
index 20df9ed79..4d1728575 100644
--- a/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySnapshotRetrievalTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Registry/MockRegistrySnapshotRetrievalTests.cs
@@ -15,7 +15,7 @@ private static MethodInfo GetMethodInfo()
public sealed class GetMethodSetupsTests
{
- [Fact]
+ [Test]
public async Task WithActiveScenarioAndScopedSetup_YieldsScopedThenSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -33,7 +33,7 @@ public async Task WithActiveScenarioAndScopedSetup_YieldsScopedThenSnapshot()
await That(setups[1]).IsSameAs(snapshotSetup);
}
- [Fact]
+ [Test]
public async Task WithActiveScenarioButNoScopedBucket_FallsBackToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -48,7 +48,7 @@ public async Task WithActiveScenarioButNoScopedBucket_FallsBackToSnapshot()
await That(setups[0]).IsSameAs(snapshotSetup);
}
- [Fact]
+ [Test]
public async Task WithSnapshotAndGlobalDictSetups_YieldsSnapshotBeforeGlobalDict()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -65,7 +65,7 @@ public async Task WithSnapshotAndGlobalDictSetups_YieldsSnapshotBeforeGlobalDict
await That(setups[1]).IsSameAs(globalDictSetup);
}
- [Fact]
+ [Test]
public async Task WithSnapshotSetupOnly_YieldsSnapshotSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -82,7 +82,7 @@ public async Task WithSnapshotSetupOnly_YieldsSnapshotSetup()
public sealed class GetIndexerSetupTests
{
- [Fact]
+ [Test]
public async Task ByAccess_WithActiveScenarioAndScopedDoesNotMatch_FallsBackToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -98,7 +98,7 @@ public async Task ByAccess_WithActiveScenarioAndScopedDoesNotMatch_FallsBackToSn
await That(result).IsSameAs(snapshotSetup);
}
- [Fact]
+ [Test]
public async Task ByAccess_WithSnapshotSetupOnly_ReturnsSnapshotSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -111,7 +111,7 @@ public async Task ByAccess_WithSnapshotSetupOnly_ReturnsSnapshotSetup()
await That(result).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task ByPredicate_WithActiveScenarioAndPredicateRejectsScoped_FallsBackToSnapshot()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -127,7 +127,7 @@ public async Task ByPredicate_WithActiveScenarioAndPredicateRejectsScoped_FallsB
await That(result).IsSameAs(snapshotSetup);
}
- [Fact]
+ [Test]
public async Task ByPredicate_WithSnapshotSetupOnly_ReturnsSnapshotSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -143,7 +143,7 @@ public async Task ByPredicate_WithSnapshotSetupOnly_ReturnsSnapshotSetup()
public sealed class RemoveEventSnapshotByNameTests
{
- [Fact]
+ [Test]
public async Task RemoveEvent_WhenUnsubscribeMemberIdDiffersFromSubscribe_FiresUnsubscribedCallbackViaNameScan()
{
// The source generator mints separate subscribe and unsubscribe member ids and registers the
@@ -167,7 +167,7 @@ public async Task RemoveEvent_WhenUnsubscribeMemberIdDiffersFromSubscribe_FiresU
public sealed class GetUnusedSetupsTests
{
- [Fact]
+ [Test]
public async Task IncludesIndexerSnapshotSetup_WhenNoInteractionsMatch()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -180,7 +180,7 @@ public async Task IncludesIndexerSnapshotSetup_WhenNoInteractionsMatch()
await That(unused).Contains(setup);
}
- [Fact]
+ [Test]
public async Task IncludesMethodSnapshotSetup_WhenNoInteractionsMatch()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
diff --git a/Tests/Mockolate.Internal.Tests/Registry/MockRegistryTests.cs b/Tests/Mockolate.Internal.Tests/Registry/MockRegistryTests.cs
index 8255ede7e..a6e2be493 100644
--- a/Tests/Mockolate.Internal.Tests/Registry/MockRegistryTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Registry/MockRegistryTests.cs
@@ -19,7 +19,7 @@ private static MethodInfo GetMethodInfo()
public sealed class ConstructorSkipFlagAgreementTests
{
- [Fact]
+ [Test]
public async Task BehaviorAndInteractions_WhenSkipFlagsDisagree_Throws()
{
MockBehavior recordingBehavior = MockBehavior.Default;
@@ -34,7 +34,7 @@ await That(Act).Throws()
.WithMessage("*SkipInteractionRecording*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task BehaviorAndInteractions_WhenSkippingBehaviorMeetsRecordingInteractions_Throws()
{
MockBehavior skippingBehavior = MockBehavior.Default.SkippingInteractionRecording();
@@ -49,7 +49,7 @@ await That(Act).Throws()
.WithMessage("*SkipInteractionRecording*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task RegistryAndInteractions_WhenSkipFlagsDisagree_Throws()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -64,7 +64,7 @@ await That(Act).Throws()
.WithMessage("*SkipInteractionRecording*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task RegistryAndInteractions_WhenSkippingRegistryMeetsRecordingInteractions_Throws()
{
MockBehavior skippingBehavior = MockBehavior.Default.SkippingInteractionRecording();
@@ -83,7 +83,7 @@ await That(Act).Throws()
public sealed class GetIndexerSetupScenarioScopingTests
{
- [Fact]
+ [Test]
public async Task WithActiveScenario_ShouldReturnScopedSetupOverGlobalSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -98,7 +98,7 @@ public async Task WithActiveScenario_ShouldReturnScopedSetupOverGlobalSetup()
await That(result).IsSameAs(scopedSetup);
}
- [Fact]
+ [Test]
public async Task WithoutActiveScenario_ShouldFallBackToGlobalSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -115,7 +115,7 @@ public async Task WithoutActiveScenario_ShouldFallBackToGlobalSetup()
public sealed class IndexerFallbackStoresValueTests
{
- [Fact]
+ [Test]
public async Task ApplyIndexerGetter_WithNullSetup_ShouldStoreBaseValueForLaterLookup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -129,7 +129,7 @@ public async Task ApplyIndexerGetter_WithNullSetup_ShouldStoreBaseValueForLaterL
await That(second).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task GetIndexerFallback_ShouldStoreDefaultForLaterLookup()
{
int counter = 0;
@@ -148,7 +148,7 @@ public async Task GetIndexerFallback_ShouldStoreDefaultForLaterLookup()
public sealed class ApplyIndexerGetterLazyGeneratorTests
{
- [Fact]
+ [Test]
public async Task WithNullSetup_LooseMode_NoStoredValue_ShouldInvokeGeneratorAndStore()
{
int callCount = 0;
@@ -164,7 +164,7 @@ public async Task WithNullSetup_LooseMode_NoStoredValue_ShouldInvokeGeneratorAnd
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task WithNullSetup_StrictMode_NoStoredValue_ShouldThrow()
{
MockBehavior behavior = MockBehavior.Default.ThrowingWhenNotSetup();
@@ -180,7 +180,7 @@ await That(Act).Throws()
.WithMessage("*was accessed without prior setup*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task WithNullSetup_StrictMode_WhenValueWasPreviouslyStored_ShouldReturnStored()
{
MockBehavior behavior = MockBehavior.Default.ThrowingWhenNotSetup();
@@ -197,7 +197,7 @@ public async Task WithNullSetup_StrictMode_WhenValueWasPreviouslyStored_ShouldRe
public sealed class GetIndexerFallbackTests
{
- [Fact]
+ [Test]
public async Task StrictMode_NoStoredValue_ShouldThrow()
{
MockBehavior behavior = MockBehavior.Default.ThrowingWhenNotSetup();
@@ -213,7 +213,7 @@ await That(Act).Throws()
.WithMessage("*was accessed without prior setup*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task WhenValueWasPreviouslyStored_ShouldReturnStoredWithoutGeneratingDefault()
{
int counter = 0;
@@ -232,7 +232,7 @@ public async Task WhenValueWasPreviouslyStored_ShouldReturnStoredWithoutGenerati
public sealed class WrapConstructorTests
{
- [Fact]
+ [Test]
public async Task WhenBehaviorSkipsInteractionRecording_WrappedRegistryAlsoSkipsRecording()
{
MockBehavior behavior = MockBehavior.Default.SkippingInteractionRecording();
@@ -250,7 +250,7 @@ public async Task WhenBehaviorSkipsInteractionRecording_WrappedRegistryAlsoSkips
public sealed class VerifyPropertyStringKeyedTests
{
- [Fact]
+ [Test]
public async Task MockGot_WhenNameDoesNotMatch_ShouldReturnNever()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -261,7 +261,7 @@ public async Task MockGot_WhenNameDoesNotMatch_ShouldReturnNever()
await That(result).Never();
}
- [Fact]
+ [Test]
public async Task MockGot_WhenNameMatches_ShouldReturnOnce()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -272,7 +272,7 @@ public async Task MockGot_WhenNameMatches_ShouldReturnOnce()
await That(result).Once();
}
- [Fact]
+ [Test]
public async Task MockGot_WithoutInteractions_ShouldReturnNeverResultWithExpectation()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -283,7 +283,7 @@ public async Task MockGot_WithoutInteractions_ShouldReturnNeverResultWithExpecta
await That(((IVerificationResult)result).Expectation).IsEqualTo("got property bar");
}
- [Fact]
+ [Test]
public async Task MockSet_WhenNameAndValueMatches_ShouldReturnOnce()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -295,7 +295,7 @@ public async Task MockSet_WhenNameAndValueMatches_ShouldReturnOnce()
await That(result).Once();
}
- [Fact]
+ [Test]
public async Task MockSet_WhenOnlyNameMatches_ShouldReturnNever()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -307,7 +307,7 @@ public async Task MockSet_WhenOnlyNameMatches_ShouldReturnNever()
await That(result).Never();
}
- [Fact]
+ [Test]
public async Task MockSet_WhenOnlyValueMatches_ShouldReturnNever()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -319,7 +319,7 @@ public async Task MockSet_WhenOnlyValueMatches_ShouldReturnNever()
await That(result).Never();
}
- [Fact]
+ [Test]
public async Task MockSet_WithoutInteractions_ShouldReturnNeverResultWithExpectation()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -331,7 +331,7 @@ public async Task MockSet_WithoutInteractions_ShouldReturnNeverResultWithExpecta
await That(((IVerificationResult)result).Expectation).IsEqualTo("set property bar to It.IsAny()");
}
- [Fact]
+ [Test]
public async Task VerifyProperty_WhenNameContainsNoDot_ShouldIncludeFullNameInExpectation()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -342,7 +342,7 @@ public async Task VerifyProperty_WhenNameContainsNoDot_ShouldIncludeFullNameInEx
await That(((IVerificationResult)result).Expectation).IsEqualTo("got property SomeNameWithoutADot");
}
- [Fact]
+ [Test]
public async Task VerifyProperty_WhenNameStartsWithDot_ShouldOmitDotInExpectation()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -356,7 +356,7 @@ public async Task VerifyProperty_WhenNameStartsWithDot_ShouldOmitDotInExpectatio
public sealed class SubscribedToStringKeyedTests
{
- [Fact]
+ [Test]
public async Task Subscribed_WhenNameDoesNotMatch_ShouldReturnNever()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -367,7 +367,7 @@ public async Task Subscribed_WhenNameDoesNotMatch_ShouldReturnNever()
await That(result).Never();
}
- [Fact]
+ [Test]
public async Task Subscribed_WhenNameMatches_ShouldReturnOnce()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -378,7 +378,7 @@ public async Task Subscribed_WhenNameMatches_ShouldReturnOnce()
await That(result).Once();
}
- [Fact]
+ [Test]
public async Task Subscribed_WithoutInteractions_ShouldReturnNeverResultWithExpectation()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -392,7 +392,7 @@ public async Task Subscribed_WithoutInteractions_ShouldReturnNeverResultWithExpe
public sealed class UnsubscribedFromStringKeyedTests
{
- [Fact]
+ [Test]
public async Task Unsubscribed_WhenNameDoesNotMatch_ShouldReturnNever()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -403,7 +403,7 @@ public async Task Unsubscribed_WhenNameDoesNotMatch_ShouldReturnNever()
await That(result).Never();
}
- [Fact]
+ [Test]
public async Task Unsubscribed_WhenNameMatches_ShouldReturnOnce()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -414,7 +414,7 @@ public async Task Unsubscribed_WhenNameMatches_ShouldReturnOnce()
await That(result).Once();
}
- [Fact]
+ [Test]
public async Task Unsubscribed_WithoutInteractions_ShouldReturnNeverResultWithExpectation()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -428,7 +428,7 @@ public async Task Unsubscribed_WithoutInteractions_ShouldReturnNeverResultWithEx
public sealed class GetMethodSetupSnapshotTests
{
- [Fact]
+ [Test]
public async Task WithEmptyTable_ShouldReturnNull()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -438,7 +438,7 @@ public async Task WithEmptyTable_ShouldReturnNull()
await That(result).IsNull();
}
- [Fact]
+ [Test]
public async Task WithMemberIdAtBoundary_ShouldReturnTheBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -452,7 +452,7 @@ public async Task WithMemberIdAtBoundary_ShouldReturnTheBucket()
await That(result!).Contains(setup);
}
- [Fact]
+ [Test]
public async Task WithMemberIdBeyondTable_ShouldReturnNull()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -468,7 +468,7 @@ public async Task WithMemberIdBeyondTable_ShouldReturnNull()
public sealed class GetIndexerSetupSnapshotTests
{
- [Fact]
+ [Test]
public async Task WithEmptyTable_ShouldReturnNull()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -478,7 +478,7 @@ public async Task WithEmptyTable_ShouldReturnNull()
await That(result).IsNull();
}
- [Fact]
+ [Test]
public async Task WithMemberIdAtBoundary_ShouldReturnTheBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -491,7 +491,7 @@ public async Task WithMemberIdAtBoundary_ShouldReturnTheBucket()
await That(result!).Contains(setup);
}
- [Fact]
+ [Test]
public async Task WithMemberIdBeyondTable_ShouldReturnNull()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -506,7 +506,7 @@ public async Task WithMemberIdBeyondTable_ShouldReturnNull()
public sealed class GetEventSetupSnapshotTests
{
- [Fact]
+ [Test]
public async Task WithEmptyTable_ShouldReturnNull()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -516,7 +516,7 @@ public async Task WithEmptyTable_ShouldReturnNull()
await That(result).IsNull();
}
- [Fact]
+ [Test]
public async Task WithMemberIdAtBoundary_ShouldReturnTheBucket()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -529,7 +529,7 @@ public async Task WithMemberIdAtBoundary_ShouldReturnTheBucket()
await That(result!).Contains(setup);
}
- [Fact]
+ [Test]
public async Task WithMemberIdBeyondTable_ShouldReturnNull()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -544,7 +544,7 @@ public async Task WithMemberIdBeyondTable_ShouldReturnNull()
public sealed class GetPropertyFastTests
{
- [Fact]
+ [Test]
public async Task WithActiveScenario_ShouldAlwaysTakeColdPath()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -562,7 +562,7 @@ public async Task WithActiveScenario_ShouldAlwaysTakeColdPath()
await That(result).IsEqualTo(99);
}
- [Fact]
+ [Test]
public async Task WithBaseValueAccessor_ShouldAlwaysTakeColdPath()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -583,7 +583,7 @@ int Base()
await That(result).IsEqualTo(99);
}
- [Fact]
+ [Test]
public async Task WithNullSnapshotAtMemberIdSlot_ShouldFallBackToColdPathWithoutThrowing()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -598,7 +598,7 @@ await That(result).IsEqualTo(7)
"registering at index 5 sizes the member-id table to 6 and leaves indices 0..4 null, and reading such a slot must fall through to the cold path rather than dereference the null PropertySetup");
}
- [Fact]
+ [Test]
public async Task WithoutSnapshotSetup_ShouldFallBackToColdPath()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -608,7 +608,7 @@ public async Task WithoutSnapshotSetup_ShouldFallBackToColdPath()
await That(result).IsEqualTo(7);
}
- [Fact]
+ [Test]
public async Task WithSnapshotSetup_ShouldBypassSlowResolverAndReturnSetupValue()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -635,7 +635,7 @@ int Generator(MockBehavior _)
public sealed class SetPropertyFastTests
{
- [Fact]
+ [Test]
public async Task WhenMemberIdSetupDiffersFromDictSetup_ShouldUseMemberIdSetupInDefaultScope()
{
// Pins the member-id-table lookup block inside SetPropertyFast. The first registration goes
@@ -659,7 +659,7 @@ public async Task WhenMemberIdSetupDiffersFromDictSetup_ShouldUseMemberIdSetupIn
await That(skipBase).IsTrue();
}
- [Fact]
+ [Test]
public async Task WithActiveScenario_ShouldRouteToScenarioSetupOverMemberIdTableSetup()
{
// Pins the IsNullOrEmpty(Scenario) guard at the top of SetPropertyFast: when a scenario is
@@ -684,7 +684,7 @@ public async Task WithActiveScenario_ShouldRouteToScenarioSetupOverMemberIdTable
await That(skipBase).IsTrue();
}
- [Fact]
+ [Test]
public async Task WithoutSnapshotSetup_ShouldFallBackToResolveSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -699,7 +699,7 @@ public async Task WithoutSnapshotSetup_ShouldFallBackToResolveSetup()
await That(after).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task WithSnapshotSetup_ShouldInvokeSetterAndStoreValue()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -717,7 +717,7 @@ public async Task WithSnapshotSetup_ShouldInvokeSetterAndStoreValue()
public sealed class AddEventMemberIdTests
{
- [Fact]
+ [Test]
public async Task AddEvent_WithMemberId_ShouldRecordAsEventSubscription()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -728,7 +728,7 @@ public async Task AddEvent_WithMemberId_ShouldRecordAsEventSubscription()
await That(recorded).IsExactly();
}
- [Fact]
+ [Test]
public async Task AddEvent_WithMemberIdAndMatchingSnapshot_ShouldInvokeSubscribedCallback()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -742,7 +742,7 @@ public async Task AddEvent_WithMemberIdAndMatchingSnapshot_ShouldInvokeSubscribe
await That(subscribedCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task AddEvent_WithNullMethod_ShouldThrowMockException()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -758,7 +758,7 @@ void Act()
public sealed class RemoveEventMemberIdTests
{
- [Fact]
+ [Test]
public async Task RemoveEvent_WithMemberId_ShouldRecordAsEventUnsubscription()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -769,7 +769,7 @@ public async Task RemoveEvent_WithMemberId_ShouldRecordAsEventUnsubscription()
await That(recorded).IsExactly();
}
- [Fact]
+ [Test]
public async Task RemoveEvent_WithMemberIdAndMatchingSnapshot_ShouldInvokeUnsubscribedCallback()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -783,7 +783,7 @@ public async Task RemoveEvent_WithMemberIdAndMatchingSnapshot_ShouldInvokeUnsubs
await That(unsubscribedCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task RemoveEvent_WithNullMethod_ShouldThrowMockException()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -799,7 +799,7 @@ void Act()
public sealed class SetPropertyFallbackBehaviorTests
{
- [Fact]
+ [Test]
public async Task SetProperty_WithoutSnapshot_ShouldReturnBehaviorSkipBaseClassWhenSetupAllowsBase()
{
MockBehavior behavior = MockBehavior.Default.SkippingBaseClass();
@@ -810,7 +810,7 @@ public async Task SetProperty_WithoutSnapshot_ShouldReturnBehaviorSkipBaseClassW
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task SetProperty_WithoutSnapshot_ShouldReturnFalseWhenBehaviorDoesNotSkip()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -823,7 +823,7 @@ public async Task SetProperty_WithoutSnapshot_ShouldReturnFalseWhenBehaviorDoesN
public sealed class TryGetBufferTests
{
- [Fact]
+ [Test]
public async Task VerifyMethodTyped_WithNonFastInteractions_ShouldFallToSlowPath()
{
// Pins the `Interactions is FastMockInteractions` type-pattern guard at the top of
@@ -884,7 +884,7 @@ void IMockInteractions.Verified(IEnumerable interactions) { }
public sealed class GetIndexerSetupSnapshotBoundaryTests
{
- [Fact]
+ [Test]
public async Task WithMemberIdEqualToTableLength_ShouldReturnNullWithoutThrowing()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -899,7 +899,7 @@ public async Task WithMemberIdEqualToTableLength_ShouldReturnNullWithoutThrowing
public sealed class GetPropertyFastSnapshotNullSlotTests
{
- [Fact]
+ [Test]
public async Task GetPropertyFast_WhenSnapshotTableHasNullEntryAtMemberId_ShouldFallToColdPath()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -917,7 +917,7 @@ await That(result).IsEqualTo(7)
public sealed class SetPropertyFastScenarioRoutingTests
{
- [Fact]
+ [Test]
public async Task SetPropertyFast_WithActiveScenario_ShouldUseColdPathAndWriteToScenarioSetup()
{
// Pins the `string.IsNullOrEmpty(Scenario)` scenario guard around the int-keyed
@@ -946,7 +946,7 @@ public async Task SetPropertyFast_WithActiveScenario_ShouldUseColdPathAndWriteTo
public sealed class SetPropertyFastSnapshotInTableOnlyTests
{
- [Fact]
+ [Test]
public async Task SetPropertyFast_WithSnapshotOnlyInIntKeyedTable_ShouldHonorHotPath()
{
// Pins the `matchingSetup = table[memberId];` assignment inside SetPropertyFast's
@@ -978,7 +978,7 @@ void Act()
public sealed class GetPropertyFastInteractionRecordingTests
{
- [Fact]
+ [Test]
public async Task WithSharedAccessSingleton_AndMatchingFastBuffer_ShouldAppendToBuffer()
{
FastMockInteractions store = new(1);
@@ -993,7 +993,7 @@ public async Task WithSharedAccessSingleton_AndMatchingFastBuffer_ShouldAppendTo
await That(result).IsEqualTo(7);
}
- [Fact]
+ [Test]
public async Task WithSharedAccessSingleton_WithoutMatchingBuffer_ShouldRegisterTheSingleton()
{
FastMockInteractions store = new(0);
@@ -1006,7 +1006,7 @@ public async Task WithSharedAccessSingleton_WithoutMatchingBuffer_ShouldRegister
await That(recorded).IsSameAs(access);
}
- [Fact]
+ [Test]
public async Task WithStringName_AndMatchingFastBuffer_ShouldAppendToBuffer()
{
FastMockInteractions store = new(1);
@@ -1021,7 +1021,7 @@ public async Task WithStringName_AndMatchingFastBuffer_ShouldAppendToBuffer()
await That(result).IsEqualTo(7);
}
- [Fact]
+ [Test]
public async Task WithStringName_AtBufferLengthBoundary_ShouldFallBackWithoutThrowing()
{
FastMockInteractions store = new(1);
@@ -1033,7 +1033,7 @@ public async Task WithStringName_AtBufferLengthBoundary_ShouldFallBackWithoutThr
await That(registry.Interactions.Count).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task WithStringName_AtTableLengthBoundary_ShouldFallToColdPathWithoutThrowing()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1046,7 +1046,7 @@ public async Task WithStringName_AtTableLengthBoundary_ShouldFallToColdPathWitho
await That(result).IsEqualTo(7);
}
- [Fact]
+ [Test]
public async Task WithStringName_WhenBehaviorSkipsInteractionRecording_ShouldNotRecord()
{
MockBehavior behavior = MockBehavior.Default.SkippingInteractionRecording();
@@ -1062,7 +1062,7 @@ public async Task WithStringName_WhenBehaviorSkipsInteractionRecording_ShouldNot
await That(registry.Interactions.Count).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task WithStringName_WithoutMatchingBuffer_ShouldFallBackToRegisterPropertyGetterAccess()
{
FastMockInteractions store = new(0);
@@ -1078,7 +1078,7 @@ await That(recorded).IsExactly()
public sealed class SetPropertyMemberIdTests
{
- [Fact]
+ [Test]
public async Task SetProperty_WithMemberId_AndSetupOverridesSkipBaseClass_ShouldReturnSetupOverride()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1092,7 +1092,7 @@ public async Task SetProperty_WithMemberId_AndSetupOverridesSkipBaseClass_Should
await That(skipBase).IsTrue();
}
- [Fact]
+ [Test]
public async Task SetProperty_WithMemberId_AtBufferLengthBoundary_ShouldFallBackWithoutThrowing()
{
FastMockInteractions store = new(1);
@@ -1107,7 +1107,7 @@ public async Task SetProperty_WithMemberId_AtBufferLengthBoundary_ShouldFallBack
await That(recorded).IsExactly>();
}
- [Fact]
+ [Test]
public async Task SetProperty_WithMemberId_ShouldInvokeSetterAndStoreValue()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1121,7 +1121,7 @@ public async Task SetProperty_WithMemberId_ShouldInvokeSetterAndStoreValue()
await That(after).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task SetProperty_WithoutMemberId_AndSetupOverridesSkipBaseClass_ShouldReturnSetupOverride()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1138,7 +1138,7 @@ public async Task SetProperty_WithoutMemberId_AndSetupOverridesSkipBaseClass_Sho
public sealed class SetPropertyFastTableBoundaryTests
{
- [Fact]
+ [Test]
public async Task SetPropertyFast_AtTableLengthBoundary_ShouldFallToColdPathWithoutThrowing()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1154,7 +1154,7 @@ public async Task SetPropertyFast_AtTableLengthBoundary_ShouldFallToColdPathWith
public sealed class AddRemoveEventErrorMessageTests
{
- [Fact]
+ [Test]
public async Task AddEvent_WithMemberId_AndNullMethod_ShouldThrowSubscriptionMessage()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1168,7 +1168,7 @@ await That(Act).Throws()
.WithMessage("The method of an event subscription may not be null.");
}
- [Fact]
+ [Test]
public async Task AddEvent_WithStringName_AndNullMethod_ShouldThrowSubscriptionMessage()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1182,7 +1182,7 @@ await That(Act).Throws()
.WithMessage("The method of an event subscription may not be null.");
}
- [Fact]
+ [Test]
public async Task RemoveEvent_WithMemberId_AndNullMethod_ShouldThrowUnsubscriptionMessage()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1196,7 +1196,7 @@ await That(Act).Throws()
.WithMessage("The method of an event unsubscription may not be null.");
}
- [Fact]
+ [Test]
public async Task RemoveEvent_WithStringName_AndNullMethod_ShouldThrowUnsubscriptionMessage()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1213,7 +1213,7 @@ await That(Act).Throws()
public sealed class RemoveEventScenarioRoutingTests
{
- [Fact]
+ [Test]
public async Task AddEvent_WithMemberId_AndActiveScenario_ShouldRouteToScenarioSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
@@ -1231,7 +1231,7 @@ public async Task AddEvent_WithMemberId_AndActiveScenario_ShouldRouteToScenarioS
await That(scenarioCallbackCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task RemoveEvent_WithMemberId_AndActiveScenario_ShouldRouteToScenarioSetup()
{
MockRegistry registry = new(MockBehavior.Default, new FastMockInteractions(0));
diff --git a/Tests/Mockolate.Internal.Tests/Setup/IndexerSetupTests.cs b/Tests/Mockolate.Internal.Tests/Setup/IndexerSetupTests.cs
index 515534998..e3a94c2a4 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/IndexerSetupTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/IndexerSetupTests.cs
@@ -7,7 +7,7 @@ namespace Mockolate.Internal.Tests.Setup;
public sealed class IndexerSetupTests
{
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -21,7 +21,7 @@ public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -35,7 +35,7 @@ public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -49,7 +49,7 @@ public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -62,7 +62,7 @@ public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -75,7 +75,7 @@ public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -88,7 +88,7 @@ public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -101,7 +101,7 @@ public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -114,7 +114,7 @@ public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
{
IndexerSetup setup = new(
@@ -139,7 +139,7 @@ public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
await That(stored).IsEqualTo("base");
}
- [Fact]
+ [Test]
public async Task GetResult_WithDefaultValueGenerator_StoresComputedValueForLaterLookup()
{
IndexerSetup setup = new(
@@ -164,7 +164,7 @@ public async Task GetResult_WithDefaultValueGenerator_StoresComputedValueForLate
await That(stored).IsEqualTo("generated");
}
- [Fact]
+ [Test]
public async Task MatchesAccess_WithUnknownAccessType_ShouldReturnFalse()
{
IndexerSetup setup = new(
@@ -177,7 +177,7 @@ public async Task MatchesAccess_WithUnknownAccessType_ShouldReturnFalse()
await That(matches).IsFalse();
}
- [Fact]
+ [Test]
public async Task SetResult_WhenValueDoesNotCastToTValue_ShouldNotInvokeSetterCallbacks()
{
MyIndexerSetup setup = new();
@@ -190,7 +190,7 @@ public async Task SetResult_WhenValueDoesNotCastToTValue_ShouldNotInvokeSetterCa
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task TryCast_WhenValueIsNotOfTargetTypeAndNotNull_ShouldReturnFalse()
{
bool success = FakeIndexerSetup.InvokeTryCast(42, out string _, MockBehavior.Default);
@@ -198,7 +198,7 @@ public async Task TryCast_WhenValueIsNotOfTargetTypeAndNotNull_ShouldReturnFalse
await That(success).IsFalse();
}
- [Fact]
+ [Test]
public async Task TryCast_WhenValueIsNull_ShouldReturnTrue()
{
bool success = FakeIndexerSetup.InvokeTryCast(null, out string result, MockBehavior.Default);
@@ -209,7 +209,7 @@ public async Task TryCast_WhenValueIsNull_ShouldReturnTrue()
public sealed class With2Levels
{
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -223,7 +223,7 @@ public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -237,7 +237,7 @@ public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -251,7 +251,7 @@ public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -264,7 +264,7 @@ public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenAssignedValueDoesNotCastToTValue_ShouldNotExecute()
{
int callCount = 0;
@@ -277,7 +277,7 @@ public async Task ExecuteSetterCallback_WhenAssignedValueDoesNotCastToTValue_Sho
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -290,7 +290,7 @@ public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -303,7 +303,7 @@ public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -316,7 +316,7 @@ public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -329,7 +329,7 @@ public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
{
IndexerSetup setup = new(
@@ -355,7 +355,7 @@ public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
await That(stored).IsEqualTo("base");
}
- [Fact]
+ [Test]
public async Task GetResult_WithFuncGenerator_AndInitialization_ShouldUseInitializationValue()
{
IndexerSetup setup = new(
@@ -382,7 +382,7 @@ public async Task GetResult_WithFuncGenerator_AndInitialization_ShouldUseInitial
await That(stored).IsEqualTo("7-9");
}
- [Fact]
+ [Test]
public async Task MatchesAccess_WithUnknownAccessType_ShouldReturnFalse()
{
IndexerSetup setup = new(
@@ -422,7 +422,7 @@ public void DoSetResult(
public sealed class With3Levels
{
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -436,7 +436,7 @@ public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -450,7 +450,7 @@ public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -464,7 +464,7 @@ public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -477,7 +477,7 @@ public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenAssignedValueDoesNotCastToTValue_ShouldNotExecute()
{
int callCount = 0;
@@ -490,7 +490,7 @@ public async Task ExecuteSetterCallback_WhenAssignedValueDoesNotCastToTValue_Sho
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -503,7 +503,7 @@ public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -516,7 +516,7 @@ public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -529,7 +529,7 @@ public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -542,7 +542,7 @@ public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
{
IndexerSetup setup = new(
@@ -571,7 +571,7 @@ public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
await That(stored).IsEqualTo("base");
}
- [Fact]
+ [Test]
public async Task GetResult_WithFuncGenerator_AndInitialization_ShouldUseInitializationValue()
{
IndexerSetup setup = new(
@@ -599,7 +599,7 @@ public async Task GetResult_WithFuncGenerator_AndInitialization_ShouldUseInitial
await That(stored).IsEqualTo("7-8-9");
}
- [Fact]
+ [Test]
public async Task MatchesAccess_WithUnknownAccessType_ShouldReturnFalse()
{
IndexerSetup setup = new(
@@ -641,7 +641,7 @@ public void DoSetResult(
public sealed class With4Levels
{
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -656,7 +656,7 @@ public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -670,7 +670,7 @@ public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -685,7 +685,7 @@ public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -699,7 +699,7 @@ public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenAssignedValueDoesNotCastToTValue_ShouldNotExecute()
{
int callCount = 0;
@@ -713,7 +713,7 @@ public async Task ExecuteSetterCallback_WhenAssignedValueDoesNotCastToTValue_Sho
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -727,7 +727,7 @@ public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -741,7 +741,7 @@ public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -755,7 +755,7 @@ public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -769,7 +769,7 @@ public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
{
IndexerSetup setup = new(
@@ -799,7 +799,7 @@ public async Task GetResult_WithBaseValue_StoresComputedValueForLaterLookup()
await That(stored).IsEqualTo("base");
}
- [Fact]
+ [Test]
public async Task GetResult_WithFuncGenerator_AndInitialization_ShouldUseInitializationValue()
{
IndexerSetup setup = new(
@@ -828,7 +828,7 @@ public async Task GetResult_WithFuncGenerator_AndInitialization_ShouldUseInitial
await That(stored).IsEqualTo("6-7-8-9");
}
- [Fact]
+ [Test]
public async Task MatchesAccess_WithUnknownAccessType_ShouldReturnFalse()
{
IndexerSetup setup = new(
@@ -872,7 +872,7 @@ public void DoSetResult(
public sealed class With5Levels
{
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -887,7 +887,7 @@ public async Task ExecuteGetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -902,7 +902,7 @@ public async Task ExecuteGetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -917,7 +917,7 @@ public async Task ExecuteGetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
@@ -931,7 +931,7 @@ public async Task ExecuteGetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
await That(callCount).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -945,7 +945,7 @@ public async Task ExecuteSetterCallback_WhenGenericTypeDoesNotMatch_ShouldNotExe
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -959,7 +959,7 @@ public async Task ExecuteSetterCallback_WhenNumberOfParametersDoesNotMatch_Shoul
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotExecute()
{
int callCount = 0;
@@ -973,7 +973,7 @@ public async Task ExecuteSetterCallback_WhenParameterTypeDoesNotMatch_ShouldNotE
await That(callCount).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task ExecuteSetterCallback_WhenTypesAndNumberMatch_ShouldExecute()
{
int callCount = 0;
diff --git a/Tests/Mockolate.Internal.Tests/Setup/MethodSetupMatchesTests.cs b/Tests/Mockolate.Internal.Tests/Setup/MethodSetupMatchesTests.cs
index 9f40bdaa5..70298172a 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/MethodSetupMatchesTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/MethodSetupMatchesTests.cs
@@ -36,7 +36,7 @@ public sealed class ReturnMethodSetupTests
{
public sealed class OneParameter
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardNamedParameterValue()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -53,7 +53,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardSingleParameterValue()
{
RecordingParametersMatch matcher = new(true);
@@ -70,7 +70,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
ReturnMethodSetup.WithParameters setup =
@@ -81,7 +81,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1_ShouldReturnFalse()
{
ReturnMethodSetup.WithParameters setup =
@@ -95,7 +95,7 @@ public async Task MatchesInteraction_WithNonMethodInvocationOfT1_ShouldReturnFal
public sealed class TwoParameters
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardBothNamedParameterValues()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -112,7 +112,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardBothParameterValues()
{
RecordingParametersMatch matcher = new(true);
@@ -129,7 +129,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
ReturnMethodSetup.WithParameters setup =
@@ -140,7 +140,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1AndT2_ShouldReturnFalse()
{
ReturnMethodSetup.WithParameters setup =
@@ -154,7 +154,7 @@ public async Task MatchesInteraction_WithNonMethodInvocationOfT1AndT2_ShouldRetu
public sealed class ThreeParameters
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardAllNamedParameterValues()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -171,7 +171,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardAllParameterValues()
{
RecordingParametersMatch matcher = new(true);
@@ -188,7 +188,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
ReturnMethodSetup.WithParameters setup =
@@ -199,7 +199,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1T2T3_ShouldReturnFalse()
{
ReturnMethodSetup.WithParameters setup =
@@ -213,7 +213,7 @@ public async Task MatchesInteraction_WithNonMethodInvocationOfT1T2T3_ShouldRetur
public sealed class FourParameters
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardAllNamedParameterValues()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -230,7 +230,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardAllParameterValues()
{
RecordingParametersMatch matcher = new(true);
@@ -247,7 +247,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
ReturnMethodSetup.WithParameters setup =
@@ -258,7 +258,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1T2T3T4_ShouldReturnFalse()
{
ReturnMethodSetup.WithParameters setup =
@@ -275,7 +275,7 @@ public sealed class VoidMethodSetupTests
{
public sealed class OneParameter
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardNamedParameterValue()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -292,7 +292,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardSingleParameterValue()
{
RecordingParametersMatch matcher = new(true);
@@ -309,7 +309,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
VoidMethodSetup.WithParameters setup =
@@ -320,7 +320,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1_ShouldReturnFalse()
{
VoidMethodSetup.WithParameters setup =
@@ -334,7 +334,7 @@ public async Task MatchesInteraction_WithNonMethodInvocationOfT1_ShouldReturnFal
public sealed class TwoParameters
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardBothNamedParameterValues()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -351,7 +351,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardBothParameterValues()
{
RecordingParametersMatch matcher = new(true);
@@ -368,7 +368,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
VoidMethodSetup.WithParameters setup =
@@ -379,7 +379,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1AndT2_ShouldReturnFalse()
{
VoidMethodSetup.WithParameters setup =
@@ -393,7 +393,7 @@ public async Task MatchesInteraction_WithNonMethodInvocationOfT1AndT2_ShouldRetu
public sealed class ThreeParameters
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardAllNamedParameterValues()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -410,7 +410,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardAllParameterValues()
{
RecordingParametersMatch matcher = new(true);
@@ -427,7 +427,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
VoidMethodSetup.WithParameters setup =
@@ -438,7 +438,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1T2T3_ShouldReturnFalse()
{
VoidMethodSetup.WithParameters setup =
@@ -452,7 +452,7 @@ public async Task MatchesInteraction_WithNonMethodInvocationOfT1T2T3_ShouldRetur
public sealed class FourParameters
{
- [Fact]
+ [Test]
public async Task Matches_WithINamedParametersMatch_ShouldForwardAllNamedParameterValues()
{
RecordingNamedParametersMatch matcher = new(true);
@@ -469,7 +469,7 @@ await That(matcher.Received[0]).IsEqualTo(new[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithIParametersMatch_ShouldForwardAllParameterValues()
{
RecordingParametersMatch matcher = new(true);
@@ -486,7 +486,7 @@ await That(matcher.Received[0]).IsEqualTo(new object?[]
});
}
- [Fact]
+ [Test]
public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
{
VoidMethodSetup.WithParameters setup =
@@ -497,7 +497,7 @@ public async Task Matches_WithUnknownIParameters_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task MatchesInteraction_WithNonMethodInvocationOfT1T2T3T4_ShouldReturnFalse()
{
VoidMethodSetup.WithParameters setup =
diff --git a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.IndexersTests.cs b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.IndexersTests.cs
index 10ddac769..024a6a56a 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.IndexersTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.IndexersTests.cs
@@ -8,7 +8,7 @@ public partial class MockSetupsTests
{
public class IndexersTests
{
- [Fact]
+ [Test]
public async Task AddAndGetLatestOrDefault_ShouldReturnLatestMatching()
{
MockSetups.IndexerSetups setups = new();
@@ -24,7 +24,7 @@ public async Task AddAndGetLatestOrDefault_ShouldReturnLatestMatching()
await That(result).IsEqualTo(setup1);
}
- [Fact]
+ [Test]
public async Task GetMatching_OnEmptyStorage_ShouldReturnNullWithoutThrowing()
{
MockSetups.IndexerSetups setups = new();
@@ -34,7 +34,7 @@ public async Task GetMatching_OnEmptyStorage_ShouldReturnNullWithoutThrowing()
await That(result).IsNull();
}
- [Fact]
+ [Test]
public async Task InitializeStorageCount_OnFreshInstance_ShouldAllocateValueStoragesArrayWithRequestedLength()
{
MockSetups.IndexerSetups setups = new();
@@ -46,7 +46,7 @@ public async Task InitializeStorageCount_OnFreshInstance_ShouldAllocateValueStor
await That(storages!.Length).IsEqualTo(5);
}
- [Fact]
+ [Test]
public async Task InitializeStorageCount_WhenAlreadyAllocated_ShouldKeepFirstAllocation()
{
MockSetups.IndexerSetups setups = new();
@@ -61,7 +61,7 @@ public async Task InitializeStorageCount_WhenAlreadyAllocated_ShouldKeepFirstAll
await That(secondAllocation).IsSameAs(firstAllocation);
}
- [Fact]
+ [Test]
public async Task Stress_ShouldMaintainCountAfterManyAdds()
{
MockSetups.IndexerSetups setups = new();
@@ -74,7 +74,7 @@ public async Task Stress_ShouldMaintainCountAfterManyAdds()
await That(setups.Count).IsEqualTo(1000);
}
- [Fact]
+ [Test]
public async Task ThreadSafety_ConcurrentAddsAndQueries_ShouldReturnConsistentMatches()
{
MockSetups.IndexerSetups setups = new();
@@ -98,7 +98,7 @@ public async Task ThreadSafety_ConcurrentAddsAndQueries_ShouldReturnConsistentMa
await That(result).IsEqualTo(finalMatch);
}
- [Fact]
+ [Test]
public async Task ThreadSafety_ShouldHandleParallelAdds()
{
MockSetups.IndexerSetups setups = new();
diff --git a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.MethodsTests.cs b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.MethodsTests.cs
index d76388a0e..8d064770c 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.MethodsTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.MethodsTests.cs
@@ -7,7 +7,7 @@ public partial class MockSetupsTests
{
public class MethodsTests
{
- [Fact]
+ [Test]
public async Task AddAndRetrieve_ShouldReturnCorrectCount()
{
MockSetups.MethodSetups setups = new();
@@ -20,7 +20,7 @@ public async Task AddAndRetrieve_ShouldReturnCorrectCount()
await That(setups.Count).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task GetLatestOrDefault_OnEmptyStorage_ShouldReturnNullWithoutThrowing()
{
MockSetups.MethodSetups setups = new();
@@ -30,7 +30,7 @@ public async Task GetLatestOrDefault_OnEmptyStorage_ShouldReturnNullWithoutThrow
await That(result).IsNull();
}
- [Fact]
+ [Test]
public async Task GetLatestOrDefault_ShouldReturnLatestMatching()
{
MockSetups.MethodSetups setups = new();
@@ -44,7 +44,7 @@ public async Task GetLatestOrDefault_ShouldReturnLatestMatching()
await That(result).IsEqualTo(setup2);
}
- [Fact]
+ [Test]
public async Task GetLatestOrDefault_WithSingleMatchingSetup_ShouldReturnIt()
{
MockSetups.MethodSetups setups = new();
@@ -56,7 +56,7 @@ public async Task GetLatestOrDefault_WithSingleMatchingSetup_ShouldReturnIt()
await That(result).IsSameAs(setup);
}
- [Fact]
+ [Test]
public async Task Stress_ShouldMaintainCountAfterManyAdds()
{
MockSetups.MethodSetups setups = new();
@@ -69,7 +69,7 @@ public async Task Stress_ShouldMaintainCountAfterManyAdds()
await That(setups.Count).IsEqualTo(1000);
}
- [Fact]
+ [Test]
public async Task ThreadSafety_ShouldAllowConcurrentReadsDuringAdds()
{
MockSetups.MethodSetups setups = new();
@@ -87,7 +87,7 @@ public async Task ThreadSafety_ShouldAllowConcurrentReadsDuringAdds()
await That(result).IsEqualTo(needle);
}
- [Fact]
+ [Test]
public async Task ThreadSafety_ShouldHandleParallelAdds()
{
MockSetups.MethodSetups setups = new();
diff --git a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.PropertiesTests.cs b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.PropertiesTests.cs
index dbaac0868..84cc572ee 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.PropertiesTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.PropertiesTests.cs
@@ -7,7 +7,7 @@ public partial class MockSetupsTests
{
public class PropertiesTests
{
- [Fact]
+ [Test]
public async Task Add_DefaultPlaceholderAfterUserSetup_ShouldNotOverwriteUserSetup()
{
MockSetups.PropertySetups setups = new();
@@ -22,7 +22,7 @@ public async Task Add_DefaultPlaceholderAfterUserSetup_ShouldNotOverwriteUserSet
await That(setups.Count).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task Add_DefaultPlaceholderOverDefault_ShouldKeepDefaultEntry()
{
MockSetups.PropertySetups setups = new();
@@ -37,7 +37,7 @@ public async Task Add_DefaultPlaceholderOverDefault_ShouldKeepDefaultEntry()
await That(setups.Count).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task Add_ReplacingDefaultWithUserSetup_ShouldIncrementCountByOne()
{
MockSetups.PropertySetups setups = new();
@@ -54,7 +54,7 @@ public async Task Add_ReplacingDefaultWithUserSetup_ShouldIncrementCountByOne()
await That(found).IsSameAs(userSetup);
}
- [Fact]
+ [Test]
public async Task AddDuplicate_ShouldReplaceAndAdjustCount()
{
MockSetups.PropertySetups setups = new();
@@ -71,7 +71,7 @@ public async Task AddDuplicate_ShouldReplaceAndAdjustCount()
await That(found).IsEqualTo(setup2);
}
- [Fact]
+ [Test]
public async Task Stress_ShouldMaintainCountAfterManyAddsAndReplacements()
{
MockSetups.PropertySetups setups = new();
@@ -84,7 +84,7 @@ public async Task Stress_ShouldMaintainCountAfterManyAddsAndReplacements()
await That(setups.Count).IsEqualTo(100);
}
- [Fact]
+ [Test]
public async Task ThreadSafety_DuplicateKeyReplacements_ShouldPreserveSingleEntry()
{
MockSetups.PropertySetups setups = new();
@@ -98,7 +98,7 @@ public async Task ThreadSafety_DuplicateKeyReplacements_ShouldPreserveSingleEntr
await That(setup).IsNotNull();
}
- [Fact]
+ [Test]
public async Task ThreadSafety_ShouldHandleParallelAdds()
{
MockSetups.PropertySetups setups = new();
@@ -108,7 +108,7 @@ public async Task ThreadSafety_ShouldHandleParallelAdds()
await That(setups.Count).IsEqualTo(200);
}
- [Fact]
+ [Test]
public async Task TryGetValue_Nonexistent_ShouldReturnFalse()
{
MockSetups.PropertySetups setups = new();
diff --git a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.cs b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.cs
index dd5852be5..226a9fbec 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/MockSetupsTests.cs
@@ -7,7 +7,7 @@ namespace Mockolate.Internal.Tests.Setup;
public partial class MockSetupsTests
{
- [Fact]
+ [Test]
public async Task EventSetup_ToString_ShouldReturnEventName()
{
EventSetup setup = new(new MockRegistry(MockBehavior.Default, new FastMockInteractions(0)),
@@ -18,17 +18,17 @@ public async Task EventSetup_ToString_ShouldReturnEventName()
await That(result).IsEqualTo("SomeEvent");
}
- [Theory]
- [InlineData(0, 0, 0, 0, "no setups")]
- [InlineData(1, 0, 0, 0, "1 method")]
- [InlineData(2, 0, 0, 0, "2 methods")]
- [InlineData(0, 1, 0, 0, "1 property")]
- [InlineData(0, 2, 0, 0, "2 properties")]
- [InlineData(0, 0, 1, 0, "1 indexer")]
- [InlineData(0, 0, 2, 0, "2 indexers")]
- [InlineData(0, 0, 0, 1, "1 event")]
- [InlineData(0, 0, 0, 2, "2 events")]
- [InlineData(3, 5, 2, 1, "3 methods, 5 properties, 2 indexers, 1 event")]
+ [Test]
+ [Arguments(0, 0, 0, 0, "no setups")]
+ [Arguments(1, 0, 0, 0, "1 method")]
+ [Arguments(2, 0, 0, 0, "2 methods")]
+ [Arguments(0, 1, 0, 0, "1 property")]
+ [Arguments(0, 2, 0, 0, "2 properties")]
+ [Arguments(0, 0, 1, 0, "1 indexer")]
+ [Arguments(0, 0, 2, 0, "2 indexers")]
+ [Arguments(0, 0, 0, 1, "1 event")]
+ [Arguments(0, 0, 0, 2, "2 events")]
+ [Arguments(3, 5, 2, 1, "3 methods, 5 properties, 2 indexers, 1 event")]
public async Task ToString_ShouldReturnExpectedValue(
int methodCount, int propertyCount, int indexerCount, int eventCount, string expected)
{
@@ -62,7 +62,7 @@ public async Task ToString_ShouldReturnExpectedValue(
await That(result).IsEqualTo(expected);
}
- [Fact]
+ [Test]
public async Task TryGetScenario_WithEmptyName_ShouldReturnTrueAndYieldRootBucket()
{
MockSetups setups = new();
@@ -73,7 +73,7 @@ public async Task TryGetScenario_WithEmptyName_ShouldReturnTrueAndYieldRootBucke
await That(scenario).IsSameAs(setups);
}
- [Fact]
+ [Test]
public async Task TryGetScenario_WithNullName_ShouldReturnTrueAndYieldRootBucket()
{
MockSetups setups = new();
diff --git a/Tests/Mockolate.Internal.Tests/Setup/PropertySetupTests.cs b/Tests/Mockolate.Internal.Tests/Setup/PropertySetupTests.cs
index d747cd606..0e36345a4 100644
--- a/Tests/Mockolate.Internal.Tests/Setup/PropertySetupTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Setup/PropertySetupTests.cs
@@ -7,7 +7,7 @@ namespace Mockolate.Internal.Tests.Setup;
public sealed class PropertySetupTests
{
- [Fact]
+ [Test]
public async Task AutoInitializeWith_WhenAlreadyInitialized_ShouldNotOverwriteValue()
{
FakePropertySetup setup = new("p");
@@ -20,7 +20,7 @@ public async Task AutoInitializeWith_WhenAlreadyInitialized_ShouldNotOverwriteVa
await That(value).IsEqualTo(5);
}
- [Fact]
+ [Test]
public async Task DefaultInvokeGetter_WhenRequestedTypeDiffersFromBackingType_ShouldFallBackToGenerator()
{
PropertySetup.Default setup = new("p", 0x40400000);
@@ -33,7 +33,7 @@ await That(value).IsEqualTo(99f)
"the typeof-equality branch must fall through to the defaultValueGenerator; reinterpreting 0x40400000 via Unsafe.As would yield 3.0f instead");
}
- [Fact]
+ [Test]
public async Task DefaultInvokeGetter_WhenRequestedTypeIsBoxedSuperType_ShouldReturnStoredValueViaPatternMatch()
{
PropertySetup.Default setup = new("p", 42);
@@ -44,7 +44,7 @@ public async Task DefaultInvokeGetter_WhenRequestedTypeIsBoxedSuperType_ShouldRe
await That(value).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task DefaultInvokeGetterFast_WhenRequestedTypeIsBoxedSuperType_ShouldReturnStoredValueViaPatternMatch()
{
PropertySetup.Default setup = new("p", 42);
@@ -54,7 +54,7 @@ public async Task DefaultInvokeGetterFast_WhenRequestedTypeIsBoxedSuperType_Shou
await That(value).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task DefaultInvokeGetterFast_WhenStoredValueIsNullReference_ShouldReturnNullViaTypeofFastPath()
{
PropertySetup.Default setup = new("p", null!);
@@ -64,7 +64,7 @@ public async Task DefaultInvokeGetterFast_WhenStoredValueIsNullReference_ShouldR
await That(value).IsNull();
}
- [Fact]
+ [Test]
public async Task DefaultInvokeSetter_WhenValueIsNullAndUnderlyingTypeIsNullable_ShouldStoreDefault()
{
PropertySetup.Default setup = new("p", 5);
@@ -76,7 +76,7 @@ public async Task DefaultInvokeSetter_WhenValueIsNullAndUnderlyingTypeIsNullable
await That(value).IsNull();
}
- [Fact]
+ [Test]
public async Task DefaultInvokeSetter_WhenValueIsNullButUnderlyingTypeIsNonNullable_ShouldThrow()
{
PropertySetup.Default setup = new("p", 5);
@@ -91,7 +91,7 @@ await That(Act).Throws()
.WithMessage("*int*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task DefaultInvokeSetter_WhenValueTypeMismatch_ShouldThrowWithFormattedMessage()
{
PropertySetup.Default setup = new("p", 5);
@@ -106,7 +106,7 @@ await That(Act).Throws()
.WithMessage("*'int'*'string'*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task PropertySetupInvokeGetter_WhenRequestedTypeIsBoxedSuperType_ShouldReturnStoredValueViaPatternMatch()
{
PropertySetup setup = new(
@@ -119,7 +119,7 @@ public async Task PropertySetupInvokeGetter_WhenRequestedTypeIsBoxedSuperType_Sh
await That(value).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task PropertySetupInvokeGetter_WhenStoredValueIsNullReference_ShouldReturnNullViaTypeofFastPath()
{
PropertySetup setup = new(
@@ -131,7 +131,7 @@ public async Task PropertySetupInvokeGetter_WhenStoredValueIsNullReference_Shoul
await That(value).IsNull();
}
- [Fact]
+ [Test]
public async Task PropertySetupInvokeGetterFast_WhenRequestedTypeIsBoxedSuperType_ShouldReturnStoredValueViaPatternMatch()
{
PropertySetup setup = new(
@@ -143,7 +143,7 @@ public async Task PropertySetupInvokeGetterFast_WhenRequestedTypeIsBoxedSuperTyp
await That(value).IsEqualTo(42);
}
- [Fact]
+ [Test]
public async Task UserInitializeWith_SecondCall_ShouldNotOverwriteValue()
{
FakePropertySetup setup = new("p");
diff --git a/Tests/Mockolate.Internal.Tests/Usings.cs b/Tests/Mockolate.Internal.Tests/Usings.cs
index 1990b88b3..3dfd9d39f 100644
--- a/Tests/Mockolate.Internal.Tests/Usings.cs
+++ b/Tests/Mockolate.Internal.Tests/Usings.cs
@@ -1,5 +1,4 @@
global using System;
global using System.Threading.Tasks;
-global using Xunit;
global using aweXpect;
global using static aweXpect.Expect;
diff --git a/Tests/Mockolate.Internal.Tests/Verify/CountSourceTests.cs b/Tests/Mockolate.Internal.Tests/Verify/CountSourceTests.cs
index 66da8d288..5b618174e 100644
--- a/Tests/Mockolate.Internal.Tests/Verify/CountSourceTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Verify/CountSourceTests.cs
@@ -7,7 +7,7 @@ namespace Mockolate.Internal.Tests.Verify;
public class CountSourceTests
{
- [Fact]
+ [Test]
public async Task EventCountSource_Subscribe_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -25,7 +25,7 @@ public async Task EventCountSource_Subscribe_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task EventCountSource_Unsubscribe_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -44,7 +44,7 @@ public async Task EventCountSource_Unsubscribe_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGetter1_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -62,7 +62,7 @@ public async Task IndexerGetter1_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGetter2_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -82,7 +82,7 @@ public async Task IndexerGetter2_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGetter3_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -104,7 +104,7 @@ public async Task IndexerGetter3_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGetter4_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -127,7 +127,7 @@ public async Task IndexerGetter4_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerSetter1_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -147,7 +147,7 @@ public async Task IndexerSetter1_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerSetter2_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -169,7 +169,7 @@ public async Task IndexerSetter2_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerSetter3_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -192,7 +192,7 @@ public async Task IndexerSetter3_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerSetter4_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -216,7 +216,7 @@ public async Task IndexerSetter4_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task Method0_FastPath_Count_AndCountAll_AreExercised()
{
FastMockInteractions store = new(1);
@@ -234,7 +234,7 @@ public async Task Method0_FastPath_Count_AndCountAll_AreExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task Method1_FastPath_Count_AndCountAll_AreExercised()
{
FastMockInteractions store = new(1);
@@ -253,7 +253,7 @@ public async Task Method1_FastPath_Count_AndCountAll_AreExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task Method2_FastPath_Count_AndCountAll_AreExercised()
{
FastMockInteractions store = new(1);
@@ -274,7 +274,7 @@ public async Task Method2_FastPath_Count_AndCountAll_AreExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task Method3_FastPath_Count_AndCountAll_AreExercised()
{
FastMockInteractions store = new(1);
@@ -300,7 +300,7 @@ public async Task Method3_FastPath_Count_AndCountAll_AreExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task Method4_FastPath_Count_AndCountAll_AreExercised()
{
FastMockInteractions store = new(1);
@@ -328,7 +328,7 @@ public async Task Method4_FastPath_Count_AndCountAll_AreExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task PropertyGetter_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
@@ -344,7 +344,7 @@ public async Task PropertyGetter_FastPath_Count_IsExercised()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task PropertySetter_FastPath_Count_IsExercised()
{
FastMockInteractions store = new(1);
diff --git a/Tests/Mockolate.Internal.Tests/Verify/MethodCountSourcesTests.cs b/Tests/Mockolate.Internal.Tests/Verify/MethodCountSourcesTests.cs
index 8f7d5b938..baf89c235 100644
--- a/Tests/Mockolate.Internal.Tests/Verify/MethodCountSourcesTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Verify/MethodCountSourcesTests.cs
@@ -8,7 +8,7 @@ namespace Mockolate.Internal.Tests.Verify;
public class MethodCountSourcesTests
{
- [Fact]
+ [Test]
public async Task EventCountSource_ShouldReturnSubscribeCount()
{
FastMockInteractions store = new(1);
@@ -24,7 +24,7 @@ public async Task EventCountSource_ShouldReturnSubscribeCount()
await That(source.Count()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerGetter1CountSource_ShouldHonorKeyMatcher()
{
FastMockInteractions store = new(1);
@@ -39,7 +39,7 @@ public async Task IndexerGetter1CountSource_ShouldHonorKeyMatcher()
await That(source.Count()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task IndexerGetter2CountSource_ShouldHonorBothMatchers()
{
FastMockInteractions store = new(1);
@@ -56,7 +56,7 @@ public async Task IndexerGetter2CountSource_ShouldHonorBothMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task IndexerGetter3CountSource_ShouldHonorAllThreeMatchers()
{
FastMockInteractions store = new(1);
@@ -75,7 +75,7 @@ public async Task IndexerGetter3CountSource_ShouldHonorAllThreeMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task IndexerGetter4CountSource_ShouldHonorAllFourMatchers()
{
FastMockInteractions store = new(1);
@@ -95,7 +95,7 @@ public async Task IndexerGetter4CountSource_ShouldHonorAllFourMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task IndexerSetter1CountSource_ShouldHonorKeyAndValueMatchers()
{
FastMockInteractions store = new(1);
@@ -112,7 +112,7 @@ public async Task IndexerSetter1CountSource_ShouldHonorKeyAndValueMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task IndexerSetter2CountSource_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -131,7 +131,7 @@ public async Task IndexerSetter2CountSource_ShouldHonorAllMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task IndexerSetter3CountSource_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -151,7 +151,7 @@ public async Task IndexerSetter3CountSource_ShouldHonorAllMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task IndexerSetter4CountSource_ShouldHonorAllMatchers()
{
FastMockInteractions store = new(1);
@@ -172,7 +172,7 @@ public async Task IndexerSetter4CountSource_ShouldHonorAllMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task Method0CountSource_CountAll_ShouldMarkSlotsVerified()
{
FastMockInteractions store = new(1);
@@ -189,7 +189,7 @@ public async Task Method0CountSource_CountAll_ShouldMarkSlotsVerified()
await That(dest).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Method0CountSource_ShouldRouteCountAndCountAllThroughBuffer()
{
FastMockInteractions store = new(1);
@@ -204,7 +204,7 @@ public async Task Method0CountSource_ShouldRouteCountAndCountAllThroughBuffer()
await That(source.Count()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task Method1CountSource_CountAll_ShouldMarkSlotsVerified()
{
FastMockInteractions store = new(1);
@@ -221,7 +221,7 @@ public async Task Method1CountSource_CountAll_ShouldMarkSlotsVerified()
await That(dest).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Method1CountSource_ShouldHonorMatcher()
{
FastMockInteractions store = new(1);
@@ -241,7 +241,7 @@ public async Task Method1CountSource_ShouldHonorMatcher()
await That(matchNone.Count()).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task Method2CountSource_CountAll_ShouldMarkSlotsVerified()
{
FastMockInteractions store = new(1);
@@ -260,7 +260,7 @@ public async Task Method2CountSource_CountAll_ShouldMarkSlotsVerified()
await That(dest).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Method2CountSource_ShouldHonorBothMatchers()
{
FastMockInteractions store = new(1);
@@ -278,7 +278,7 @@ public async Task Method2CountSource_ShouldHonorBothMatchers()
await That(source.Count()).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task Method3CountSource_CountAll_ShouldMarkSlotsVerified()
{
FastMockInteractions store = new(1);
@@ -298,7 +298,7 @@ public async Task Method3CountSource_CountAll_ShouldMarkSlotsVerified()
await That(dest).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Method3CountSource_ShouldHonorAllThreeMatchers()
{
FastMockInteractions store = new(1);
@@ -317,7 +317,7 @@ public async Task Method3CountSource_ShouldHonorAllThreeMatchers()
await That(source.Count()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task Method4CountSource_CountAll_ShouldMarkSlotsVerified()
{
FastMockInteractions store = new(1);
@@ -339,7 +339,7 @@ public async Task Method4CountSource_CountAll_ShouldMarkSlotsVerified()
await That(dest).IsEmpty();
}
- [Fact]
+ [Test]
public async Task Method4CountSource_ShouldHonorAllFourMatchers()
{
FastMockInteractions store = new(1);
@@ -360,7 +360,7 @@ public async Task Method4CountSource_ShouldHonorAllFourMatchers()
await That(source.Count()).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task PropertyGetterCountSource_ShouldReturnRecordedCount()
{
FastMockInteractions store = new(1);
@@ -375,7 +375,7 @@ public async Task PropertyGetterCountSource_ShouldReturnRecordedCount()
await That(source.Count()).IsEqualTo(3);
}
- [Fact]
+ [Test]
public async Task PropertySetterCountSource_ShouldHonorValueMatcher()
{
FastMockInteractions store = new(1);
diff --git a/Tests/Mockolate.Internal.Tests/Verify/TypedVerifyFastPathTests.cs b/Tests/Mockolate.Internal.Tests/Verify/TypedVerifyFastPathTests.cs
index b3db8ce09..c71ac4b22 100644
--- a/Tests/Mockolate.Internal.Tests/Verify/TypedVerifyFastPathTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Verify/TypedVerifyFastPathTests.cs
@@ -8,7 +8,7 @@ namespace Mockolate.Internal.Tests.Verify;
public class TypedVerifyFastPathTests
{
- [Fact]
+ [Test]
public async Task IndexerGot_WithMemberIdAndBuffer_CountsBufferEntriesAndProducesExpectation()
{
FastMockInteractions store = new(1);
@@ -28,7 +28,7 @@ public async Task IndexerGot_WithMemberIdAndBuffer_CountsBufferEntriesAndProduce
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGot_WithMemberIdAndInstalledBuffer_OnlyWalksBuffer()
{
FastMockInteractions store = new(1);
@@ -47,7 +47,7 @@ public async Task IndexerGot_WithMemberIdAndInstalledBuffer_OnlyWalksBuffer()
await That(((IVerificationResult)result).Verify(arr => arr.Length == 0)).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerGot_WithoutBuffer_ProducesParametersDescriptionInExpectation()
{
FastMockInteractions store = new(0);
@@ -61,7 +61,7 @@ public async Task IndexerGot_WithoutBuffer_ProducesParametersDescriptionInExpect
await That(((IVerificationResult)result).Expectation).IsEqualTo("got indexer (5)");
}
- [Fact]
+ [Test]
public async Task IndexerGotTyped_WithBuffer_ProducesParametersDescriptionInExpectation()
{
FastMockInteractions store = new(1);
@@ -77,7 +77,7 @@ public async Task IndexerGotTyped_WithBuffer_ProducesParametersDescriptionInExpe
await That(((IVerificationResult)result).Expectation).IsEqualTo("got indexer (5)");
}
- [Fact]
+ [Test]
public async Task IndexerSet_WithMemberIdAndBuffer_CountsMatchingValuesAndProducesExpectation()
{
FastMockInteractions store = new(1);
@@ -100,7 +100,7 @@ public async Task IndexerSet_WithMemberIdAndBuffer_CountsMatchingValuesAndProduc
await That(((IVerificationResult)result).Verify(arr => arr.Length == 1)).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerSet_WithMemberIdAndInstalledBuffer_OnlyWalksBuffer()
{
FastMockInteractions store = new(1);
@@ -121,7 +121,7 @@ public async Task IndexerSet_WithMemberIdAndInstalledBuffer_OnlyWalksBuffer()
await That(((IVerificationResult)result).Verify(arr => arr.Length == 0)).IsTrue();
}
- [Fact]
+ [Test]
public async Task IndexerSet_WithoutBuffer_ProducesParametersDescriptionInExpectation()
{
FastMockInteractions store = new(0);
@@ -138,7 +138,7 @@ public async Task IndexerSet_WithoutBuffer_ProducesParametersDescriptionInExpect
await That(((IVerificationResult)result).Expectation).Contains(value.ToString()!);
}
- [Fact]
+ [Test]
public async Task IndexerSetTyped_WithBuffer_ProducesParametersDescriptionInExpectation()
{
FastMockInteractions store = new(1);
@@ -157,7 +157,7 @@ public async Task IndexerSetTyped_WithBuffer_ProducesParametersDescriptionInExpe
await That(((IVerificationResult)result).Expectation).Contains(value.ToString()!);
}
- [Fact]
+ [Test]
public async Task SubscribedTo_WithMemberIdAndBuffer_CountsBufferEntriesAndProducesExpectation()
{
FastMockInteractions store = new(1);
@@ -175,7 +175,7 @@ public async Task SubscribedTo_WithMemberIdAndBuffer_CountsBufferEntriesAndProdu
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task SubscribedTo_WithMemberIdButNoBuffer_FallsBackAndFiltersByName()
{
FastMockInteractions store = new(0);
@@ -193,7 +193,7 @@ public async Task SubscribedTo_WithMemberIdButNoBuffer_FallsBackAndFiltersByName
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task SubscribedToTyped_WithBuffer_ProducesEventNameInExpectation()
{
FastMockInteractions store = new(1);
@@ -206,7 +206,7 @@ public async Task SubscribedToTyped_WithBuffer_ProducesEventNameInExpectation()
await That(((IVerificationResult)result).Expectation).IsEqualTo("subscribed to event OnFoo");
}
- [Fact]
+ [Test]
public async Task SubscribedToTyped_WithMemberIdButNoBuffer_FallsBackToStringKeyedPath()
{
FastMockInteractions store = new(0);
@@ -217,7 +217,7 @@ public async Task SubscribedToTyped_WithMemberIdButNoBuffer_FallsBackToStringKey
await That(((IVerificationResult)result).Expectation).IsEqualTo("subscribed to event OnFoo");
}
- [Fact]
+ [Test]
public async Task TryGetBuffer_WhenBufferReturned_TypedFastPathIgnoresOtherInteractions()
{
FastMockInteractions store = new(1);
@@ -236,7 +236,7 @@ public async Task TryGetBuffer_WhenBufferReturned_TypedFastPathIgnoresOtherInter
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task UnsubscribedFrom_WithMemberIdAndBuffer_CountsBufferEntriesAndProducesExpectation()
{
FastMockInteractions store = new(1);
@@ -254,7 +254,7 @@ public async Task UnsubscribedFrom_WithMemberIdAndBuffer_CountsBufferEntriesAndP
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task UnsubscribedFrom_WithMemberIdButNoBuffer_FallsBackAndFiltersByName()
{
FastMockInteractions store = new(0);
@@ -272,7 +272,7 @@ public async Task UnsubscribedFrom_WithMemberIdButNoBuffer_FallsBackAndFiltersBy
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task UnsubscribedFromTyped_WithBuffer_ProducesEventNameInExpectation()
{
FastMockInteractions store = new(1);
@@ -285,7 +285,7 @@ public async Task UnsubscribedFromTyped_WithBuffer_ProducesEventNameInExpectatio
await That(((IVerificationResult)result).Expectation).IsEqualTo("unsubscribed from event OnFoo");
}
- [Fact]
+ [Test]
public async Task UnsubscribedFromTyped_WithMemberIdButNoBuffer_FallsBackToStringKeyedPath()
{
FastMockInteractions store = new(0);
@@ -296,7 +296,7 @@ public async Task UnsubscribedFromTyped_WithMemberIdButNoBuffer_FallsBackToStrin
await That(((IVerificationResult)result).Expectation).IsEqualTo("unsubscribed from event OnFoo");
}
- [Fact]
+ [Test]
public async Task UnsubscribedFromTyped_WithMemberIdButNonMatchingBufferKind_FallsBackToStringKeyedPath()
{
FastMockInteractions store = new(1);
@@ -309,7 +309,7 @@ public async Task UnsubscribedFromTyped_WithMemberIdButNonMatchingBufferKind_Fal
}
- [Fact]
+ [Test]
public async Task VerifyMethod0_TypedFastPath_ShouldCount()
{
FastMockInteractions store = new(1);
@@ -326,7 +326,7 @@ public async Task VerifyMethod0_TypedFastPath_ShouldCount()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyMethod0_WithMemberIdButNoMatchingBuffer_FallbackPredicateMatchesAllMethodInteractions()
{
FastMockInteractions store = new(0);
@@ -343,7 +343,7 @@ public async Task VerifyMethod0_WithMemberIdButNoMatchingBuffer_FallbackPredicat
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyMethod1_TypedFastPath_FailsWithExpectedMessage()
{
FastMockInteractions store = new(1);
@@ -360,7 +360,7 @@ await That(() => registry.VerifyMethod(new object(), 0, "Foo",
.Throws();
}
- [Fact]
+ [Test]
public async Task VerifyMethod1_TypedFastPath_ShouldHonorMatcher()
{
FastMockInteractions store = new(1);
@@ -381,7 +381,7 @@ public async Task VerifyMethod1_TypedFastPath_ShouldHonorMatcher()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyMethod2_TypedFastPath_AnyParameters_UsesCountAll()
{
FastMockInteractions store = new(1);
@@ -407,7 +407,7 @@ public async Task VerifyMethod2_TypedFastPath_AnyParameters_UsesCountAll()
await That(true).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyMethod3_FallbackPath_RequiresAllParametersToMatch()
{
FastMockInteractions store = new(0);
@@ -429,7 +429,7 @@ public async Task VerifyMethod3_FallbackPath_RequiresAllParametersToMatch()
await That(((IVerificationResult)result).Verify(arr => arr.Length == 1)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyMethod4_FallbackPath_RequiresAllParametersToMatch()
{
FastMockInteractions store = new(0);
@@ -453,7 +453,7 @@ public async Task VerifyMethod4_FallbackPath_RequiresAllParametersToMatch()
await That(((IVerificationResult)result).Verify(arr => arr.Length == 1)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyProperty_GetterWithMemberIdAndBuffer_CountsBufferEntriesAndProducesExpectation()
{
FastMockInteractions store = new(1);
@@ -468,7 +468,7 @@ public async Task VerifyProperty_GetterWithMemberIdAndBuffer_CountsBufferEntries
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyProperty_SetterWithMemberIdAndBuffer_CountsMatchingValuesAndProducesExpectation()
{
FastMockInteractions store = new(1);
@@ -487,7 +487,7 @@ public async Task VerifyProperty_SetterWithMemberIdAndBuffer_CountsMatchingValue
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyProperty_WithMemberIdButNoBuffer_FallbackPredicateFiltersByName()
{
FastMockInteractions store = new(0);
@@ -503,7 +503,7 @@ public async Task VerifyProperty_WithMemberIdButNoBuffer_FallbackPredicateFilter
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyProperty_WithMemberIdButNoBuffer_FallsBackToStringKeyedPath()
{
FastMockInteractions store = new(0);
@@ -519,7 +519,7 @@ public async Task VerifyProperty_WithMemberIdButNoBuffer_FallsBackToStringKeyedP
((IVerificationResult)result).Verify(arr => arr.Length == 2);
}
- [Fact]
+ [Test]
public async Task VerifyPropertySetter_WithMemberIdButNoBuffer_FallbackPredicateFiltersByName()
{
FastMockInteractions store = new(0);
@@ -536,7 +536,7 @@ public async Task VerifyPropertySetter_WithMemberIdButNoBuffer_FallbackPredicate
await That(((IVerificationResult)result).Verify(arr => arr.Length == 2)).IsTrue();
}
- [Fact]
+ [Test]
public async Task VerifyPropertySetter_WithMemberIdButNoBuffer_FallsBackToStringKeyedPath()
{
FastMockInteractions store = new(0);
@@ -553,7 +553,7 @@ public async Task VerifyPropertySetter_WithMemberIdButNoBuffer_FallsBackToString
((IVerificationResult)result).Verify(arr => arr.Length == 2);
}
- [Fact]
+ [Test]
public async Task VerifyPropertyTyped_Getter_WithBuffer_ProducesPropertyNameInExpectation()
{
FastMockInteractions store = new(1);
@@ -565,7 +565,7 @@ public async Task VerifyPropertyTyped_Getter_WithBuffer_ProducesPropertyNameInEx
await That(((IVerificationResult)result).Expectation).IsEqualTo("got property P");
}
- [Fact]
+ [Test]
public async Task VerifyPropertyTyped_Setter_WithBuffer_ProducesPropertyNameInExpectation()
{
FastMockInteractions store = new(1);
diff --git a/Tests/Mockolate.Internal.Tests/Verify/VerificationResultTests.cs b/Tests/Mockolate.Internal.Tests/Verify/VerificationResultTests.cs
index c184fa898..796b8d96e 100644
--- a/Tests/Mockolate.Internal.Tests/Verify/VerificationResultTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Verify/VerificationResultTests.cs
@@ -19,7 +19,7 @@ private static FastMethod1Buffer InstallMethod(FastMockInteractions store,
public sealed class AwaitableTests
{
- [Fact]
+ [Test]
public async Task Verify_WhenPredicateNeverSatisfies_ShouldTimeOut()
{
FastMockInteractions store = new(0);
@@ -39,7 +39,7 @@ void Act()
await That(Act).Throws();
}
- [Fact]
+ [Test]
public async Task VerifyCount_WhenPredicateNeverSatisfies_ShouldTimeOut()
{
FastMockInteractions store = new(1);
@@ -56,7 +56,7 @@ await That(Act).Throws()
.WithMessage("*timed out*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task VerifyCount_WithUseCountAll_ShouldPickCountAllNotFilteredCount()
{
// Pins the `_useCountAll ? CountAll() : Count()` conditional in Awaitable.VerifyCount.
@@ -88,7 +88,7 @@ void Act()
await That(Act).Throws();
}
- [Fact]
+ [Test]
public async Task WithCancellation_PreservesUseCountAllFlag()
{
FastMockInteractions store = new(1);
@@ -114,7 +114,7 @@ void Act()
await That(Act).DoesNotThrow();
}
- [Fact]
+ [Test]
public async Task Within_PreservesUseCountAllFlag()
{
FastMockInteractions store = new(1);
@@ -143,7 +143,7 @@ void Act()
public sealed class MapTests
{
- [Fact]
+ [Test]
public async Task Map_WhenBufferAndFastSourceBothNull_DropsToSimpleConstructor()
{
// Mirrors the buffer-only case from the other side: with neither buffer nor source, the
@@ -165,7 +165,7 @@ public async Task Map_WhenBufferAndFastSourceBothNull_DropsToSimpleConstructor()
await That(fastSourceField.GetValue(mapped)).IsNull();
}
- [Fact]
+ [Test]
public async Task Map_WhenBufferOnlyAndFastSourceNull_PreservesBuffer()
{
// The buffer-only IgnoreParameters constructor is wired with no fast source. Map must
@@ -198,7 +198,7 @@ public async Task Map_WhenBufferOnlyAndFastSourceNull_PreservesBuffer()
await That(observedLength).IsEqualTo(2);
}
- [Fact]
+ [Test]
public async Task Map_WithBuffer_PreservesFastPathSource()
{
FastMockInteractions store = new(1);
@@ -225,7 +225,7 @@ void Act()
await That(Act).DoesNotThrow();
}
- [Fact]
+ [Test]
public async Task Map_WithoutBuffer_StillCarriesPredicate()
{
FastMockInteractions store = new(0);
@@ -244,7 +244,7 @@ public async Task Map_WithoutBuffer_StillCarriesPredicate()
public sealed class CollectMatchingTests
{
- [Fact]
+ [Test]
public async Task WithBufferAndExactlyTwoRecords_PreservesSequenceOrder()
{
// Crosses the `records.Count > 1` boundary in CollectMatching at exactly N=2. Combined
@@ -276,7 +276,7 @@ public async Task WithBufferAndExactlyTwoRecords_PreservesSequenceOrder()
await That(values).IsEqualTo([10, 20,]);
}
- [Fact]
+ [Test]
public async Task WithBufferAndMultipleRecords_PreservesSequenceOrder()
{
FastMockInteractions store = new(1);
@@ -305,7 +305,7 @@ public async Task WithBufferAndMultipleRecords_PreservesSequenceOrder()
await That(values).IsEqualTo([10, 20, 30,]);
}
- [Fact]
+ [Test]
public async Task WithBufferAndNoMatchingRecord_ReturnsEmpty()
{
FastMockInteractions store = new(1);
@@ -328,7 +328,7 @@ public async Task WithBufferAndNoMatchingRecord_ReturnsEmpty()
await That(observed).IsEqualTo(0);
}
- [Fact]
+ [Test]
public async Task WithBufferAndSingleRecord_ReturnsRecord()
{
FastMockInteractions store = new(1);
@@ -351,7 +351,7 @@ public async Task WithBufferAndSingleRecord_ReturnsRecord()
await That(observed).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task WithEmptyBuffer_ReturnsEmpty()
{
FastMockInteractions store = new(1);
@@ -375,7 +375,7 @@ public async Task WithEmptyBuffer_ReturnsEmpty()
public sealed class SkipInteractionRecordingTests
{
- [Fact]
+ [Test]
public async Task Verify_WhenRecordingDisabled_AndAwaitableViaWithin_ShouldThrowMockException()
{
// Same guard, Awaitable Verify (records-array) path. Constructed with a predicate-based
@@ -395,7 +395,7 @@ await That(Act).Throws()
.WithMessage("*recording is disabled*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task VerifyCount_WhenRecordingDisabled_AndAwaitableViaWithin_ShouldThrowMockException()
{
// Same guard, Awaitable path (via Within). Distinct mutation site.
@@ -416,7 +416,7 @@ await That(Act).Throws()
.WithMessage("*recording is disabled*").AsWildcard();
}
- [Fact]
+ [Test]
public async Task VerifyCount_WhenRecordingDisabled_ShouldThrowMockException()
{
// Kills the ThrowIfRecordingDisabled statement-removal mutation on the non-Awaitable
@@ -441,7 +441,7 @@ await That(Act).Throws()
public sealed class IgnoreParametersAnyParametersTests
{
- [Fact]
+ [Test]
public async Task AnyParameters_WithoutBuffer_AndNoOverloadFilter_MatchesAllOfMethodName()
{
IMockInteractions store = new FastMockInteractions(0);
@@ -466,7 +466,7 @@ void Act()
await That(Act).DoesNotThrow();
}
- [Fact]
+ [Test]
public async Task AnyParameters_WithoutBuffer_KeepsOverloadFilter()
{
IMockInteractions store = new FastMockInteractions(0);
diff --git a/Tests/Mockolate.Internal.Tests/Web/HttpClientExtensionsTests.cs b/Tests/Mockolate.Internal.Tests/Web/HttpClientExtensionsTests.cs
index 1bfea5573..7cbb0548e 100644
--- a/Tests/Mockolate.Internal.Tests/Web/HttpClientExtensionsTests.cs
+++ b/Tests/Mockolate.Internal.Tests/Web/HttpClientExtensionsTests.cs
@@ -8,7 +8,7 @@ namespace Mockolate.Internal.Tests.Web;
public class HttpClientExtensionsTests
{
- [Fact]
+ [Test]
public async Task WhenParameterImplementsIHttpRequestMessagePropertyParameter_ShouldUseThisMatch()
{
ItExtensions.IHttpContentParameter parameter = ItExtensions.IHttpContentParameter.CreateMock()
@@ -31,7 +31,7 @@ await That(parameter.Mock.As>().Verify
.Never();
}
- [Fact]
+ [Test]
public async Task WithoutMediaTypeHeader_WhenNoneIsRequired_ShouldReturnTrue()
{
ItExtensions.IHttpContentParameter sut = It.IsHttpContent();
@@ -42,7 +42,7 @@ public async Task WithoutMediaTypeHeader_WhenNoneIsRequired_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task WithoutMediaTypeHeader_WhenOneIsRequired_ShouldReturnFalse()
{
ItExtensions.IHttpContentParameter sut = It.IsHttpContent("*");
diff --git a/Tests/Mockolate.SourceGenerators.Tests/Entities/EventEqualityComparerTests.cs b/Tests/Mockolate.SourceGenerators.Tests/Entities/EventEqualityComparerTests.cs
index 0d4517874..b23bd90ed 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/Entities/EventEqualityComparerTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/Entities/EventEqualityComparerTests.cs
@@ -9,14 +9,14 @@ namespace Mockolate.SourceGenerators.Tests.Entities;
public class EventEqualityComparerTests
{
- [Fact]
+ [Test]
public async Task BothNull_ShouldReturnTrue()
{
await That(Event.EqualityComparer.Equals(null, null)).IsTrue();
await That(Event.ContainingTypeIndependentEqualityComparer.Equals(null, null)).IsTrue();
}
- [Fact]
+ [Test]
public async Task ContainingTypeIndependent_DifferentNames_ShouldReturnFalse()
{
IEqualityComparer comparer = Event.ContainingTypeIndependentEqualityComparer;
@@ -30,7 +30,7 @@ public async Task ContainingTypeIndependent_DifferentNames_ShouldReturnFalse()
await That(comparer.Equals(e1, e2)).IsFalse();
}
- [Fact]
+ [Test]
public async Task ContainingTypeIndependent_SameNameDifferentContainingType_ShouldReturnTrue()
{
IEqualityComparer comparer = Event.ContainingTypeIndependentEqualityComparer;
@@ -44,7 +44,7 @@ public async Task ContainingTypeIndependent_SameNameDifferentContainingType_Shou
await That(comparer.Equals(fromC, fromD)).IsTrue();
}
- [Fact]
+ [Test]
public async Task EventsWithDifferentContainingType_ShouldReturnFalse()
{
IEqualityComparer comparer = Event.EqualityComparer;
@@ -58,7 +58,7 @@ public async Task EventsWithDifferentContainingType_ShouldReturnFalse()
await That(comparer.Equals(fromC, fromD)).IsFalse();
}
- [Fact]
+ [Test]
public async Task EventsWithDifferentNames_ShouldReturnFalse()
{
IEqualityComparer comparer = Event.EqualityComparer;
@@ -72,7 +72,7 @@ public async Task EventsWithDifferentNames_ShouldReturnFalse()
await That(comparer.Equals(e1, e2)).IsFalse();
}
- [Fact]
+ [Test]
public async Task LeftOrRightNull_ShouldReturnFalse()
{
IEqualityComparer comparer = Event.EqualityComparer;
diff --git a/Tests/Mockolate.SourceGenerators.Tests/Entities/MethodEqualityComparerTests.cs b/Tests/Mockolate.SourceGenerators.Tests/Entities/MethodEqualityComparerTests.cs
index 9e2fd328c..d9045f17c 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/Entities/MethodEqualityComparerTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/Entities/MethodEqualityComparerTests.cs
@@ -9,7 +9,7 @@ namespace Mockolate.SourceGenerators.Tests.Entities;
public class MethodEqualityComparerTests
{
- [Fact]
+ [Test]
public async Task WhenBothMethodsAreNull_ShouldReturnTrue()
{
IEqualityComparer comparer = Method.ContainingTypeIndependentEqualityComparer;
@@ -19,7 +19,7 @@ public async Task WhenBothMethodsAreNull_ShouldReturnTrue()
await That(result).IsTrue();
}
- [Fact]
+ [Test]
public async Task WhenLeftMethodIsNull_ShouldReturnFalse()
{
IEqualityComparer comparer = Method.ContainingTypeIndependentEqualityComparer;
@@ -30,7 +30,7 @@ public async Task WhenLeftMethodIsNull_ShouldReturnFalse()
await That(result).IsFalse();
}
- [Fact]
+ [Test]
public async Task WhenMethodsHaveDifferentNames_ShouldReturnFalse()
{
IEqualityComparer comparer = Method.ContainingTypeIndependentEqualityComparer;
@@ -42,7 +42,7 @@ public async Task WhenMethodsHaveDifferentNames_ShouldReturnFalse()
await That(result).IsFalse();
}
- [Fact]
+ [Test]
public async Task WhenMethodsHaveDifferentParameterCount_ShouldReturnFalse()
{
IEqualityComparer comparer = Method.ContainingTypeIndependentEqualityComparer;
@@ -54,7 +54,7 @@ public async Task WhenMethodsHaveDifferentParameterCount_ShouldReturnFalse()
await That(result).IsFalse();
}
- [Fact]
+ [Test]
public async Task WhenRightMethodIsNull_ShouldReturnFalse()
{
IEqualityComparer comparer = Method.ContainingTypeIndependentEqualityComparer;
diff --git a/Tests/Mockolate.SourceGenerators.Tests/Entities/MockClassEqualityTests.cs b/Tests/Mockolate.SourceGenerators.Tests/Entities/MockClassEqualityTests.cs
index 2f587c536..a7e14c681 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/Entities/MockClassEqualityTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/Entities/MockClassEqualityTests.cs
@@ -8,7 +8,7 @@ namespace Mockolate.SourceGenerators.Tests.Entities;
public class MockClassEqualityTests
{
- [Fact]
+ [Test]
public async Task ReferenceEqualMockClasses_ShouldBeEqual()
{
(Compilation compilation, INamedTypeSymbol[] symbols) = ParseSymbols(Source, "IBase");
@@ -19,7 +19,7 @@ public async Task ReferenceEqualMockClasses_ShouldBeEqual()
await That(a.Equals(null)).IsFalse();
}
- [Fact]
+ [Test]
public async Task TwoMockClassesWithDifferentConstructors_ShouldNotBeEqual()
{
(Compilation compilation, INamedTypeSymbol[] symbols) = ParseSymbols(Source,
@@ -31,7 +31,7 @@ public async Task TwoMockClassesWithDifferentConstructors_ShouldNotBeEqual()
await That(a.Equals(b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task TwoMockClassesWithSameRootAndSameAdditionals_ShouldBeEqual()
{
(Compilation compilation, INamedTypeSymbol[] symbols) = ParseSymbols(Source,
@@ -44,7 +44,7 @@ public async Task TwoMockClassesWithSameRootAndSameAdditionals_ShouldBeEqual()
await That(a.GetHashCode()).IsEqualTo(b.GetHashCode());
}
- [Fact]
+ [Test]
public async Task TwoMockClassesWithSameRootButDifferentAdditionals_ShouldNotBeEqual()
{
(Compilation compilation, INamedTypeSymbol[] symbols) = ParseSymbols(Source,
diff --git a/Tests/Mockolate.SourceGenerators.Tests/Entities/PropertyEqualityComparerTests.cs b/Tests/Mockolate.SourceGenerators.Tests/Entities/PropertyEqualityComparerTests.cs
index 17dd2c251..e86a876f1 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/Entities/PropertyEqualityComparerTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/Entities/PropertyEqualityComparerTests.cs
@@ -9,14 +9,14 @@ namespace Mockolate.SourceGenerators.Tests.Entities;
public class PropertyEqualityComparerTests
{
- [Fact]
+ [Test]
public async Task BothNull_ShouldReturnTrue()
{
await That(Property.EqualityComparer.Equals(null, null)).IsTrue();
await That(Property.ContainingTypeIndependentEqualityComparer.Equals(null, null)).IsTrue();
}
- [Fact]
+ [Test]
public async Task ContainingTypeIndependent_IndexersWithDifferentArity_ShouldReturnFalse()
{
IEqualityComparer comparer = Property.ContainingTypeIndependentEqualityComparer;
@@ -26,7 +26,7 @@ public async Task ContainingTypeIndependent_IndexersWithDifferentArity_ShouldRet
await That(comparer.Equals(arity1, arity2)).IsFalse();
}
- [Fact]
+ [Test]
public async Task ContainingTypeIndependent_IndexerVsNonIndexer_ShouldReturnFalse()
{
IEqualityComparer comparer = Property.ContainingTypeIndependentEqualityComparer;
@@ -37,7 +37,7 @@ public async Task ContainingTypeIndependent_IndexerVsNonIndexer_ShouldReturnFals
await That(comparer.Equals(nonIndexer, indexer)).IsFalse();
}
- [Fact]
+ [Test]
public async Task IndexersWithDifferentArity_ShouldReturnFalse()
{
IEqualityComparer comparer = Property.EqualityComparer;
@@ -47,7 +47,7 @@ public async Task IndexersWithDifferentArity_ShouldReturnFalse()
await That(comparer.Equals(arity1, arity2)).IsFalse();
}
- [Fact]
+ [Test]
public async Task IndexersWithDifferentContainingType_ShouldReturnFalse()
{
IEqualityComparer comparer = Property.EqualityComparer;
@@ -57,7 +57,7 @@ public async Task IndexersWithDifferentContainingType_ShouldReturnFalse()
await That(comparer.Equals(fromC, fromD)).IsFalse();
}
- [Fact]
+ [Test]
public async Task IndexerVsNonIndexer_ShouldReturnFalse()
{
IEqualityComparer comparer = Property.EqualityComparer;
@@ -68,7 +68,7 @@ public async Task IndexerVsNonIndexer_ShouldReturnFalse()
await That(comparer.Equals(nonIndexer, indexer)).IsFalse();
}
- [Fact]
+ [Test]
public async Task NonIndexersWithDifferentContainingType_ShouldReturnFalse()
{
IEqualityComparer comparer = Property.EqualityComparer;
diff --git a/Tests/Mockolate.SourceGenerators.Tests/Entities/TypeIsFormattableTests.cs b/Tests/Mockolate.SourceGenerators.Tests/Entities/TypeIsFormattableTests.cs
index f7b1af16b..9d7ebd982 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/Entities/TypeIsFormattableTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/Entities/TypeIsFormattableTests.cs
@@ -1,4 +1,5 @@
using System.Linq;
+using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
@@ -8,30 +9,30 @@ namespace Mockolate.SourceGenerators.Tests.Entities;
public class TypeIsFormattableTests
{
- [Fact]
- public async Task WhenSymbolIsObject_ShouldNotReportFormattable()
+ [Test]
+ public async Task WhenSymbolIsObject_ShouldNotReportFormattable(CancellationToken cancellationToken)
{
const string source = "public class Holder { public object Value; }";
- SyntaxTree tree = CSharpSyntaxTree.ParseText(source, cancellationToken: TestContext.Current.CancellationToken);
+ SyntaxTree tree = CSharpSyntaxTree.ParseText(source, cancellationToken: cancellationToken);
CSharpCompilation compilation = CSharpCompilation.Create(
"TestAssembly",
[tree,],
[MetadataReference.CreateFromFile(typeof(object).Assembly.Location),],
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
SemanticModel model = compilation.GetSemanticModel(tree);
- FieldDeclarationSyntax declaration = tree.GetRoot(TestContext.Current.CancellationToken).DescendantNodes()
+ FieldDeclarationSyntax declaration = tree.GetRoot(cancellationToken).DescendantNodes()
.OfType()
.First();
VariableDeclaratorSyntax variable = declaration.Declaration.Variables.Single();
- IFieldSymbol fieldSymbol = (IFieldSymbol)model.GetDeclaredSymbol(variable, TestContext.Current.CancellationToken)!;
+ IFieldSymbol fieldSymbol = (IFieldSymbol)model.GetDeclaredSymbol(variable, cancellationToken)!;
Type type = Type.From(fieldSymbol.Type);
await That(type.IsFormattable).IsFalse();
}
- [Fact]
- public async Task WhenSymbolIsSystemIFormattableItself_ShouldReportFormattable()
+ [Test]
+ public async Task WhenSymbolIsSystemIFormattableItself_ShouldReportFormattable(CancellationToken cancellationToken)
{
// The IsFormattable self-check (Type.cs:87-94) handles the case where the symbol IS
// System.IFormattable - AllInterfaces excludes the type itself, so the explicit
@@ -43,7 +44,7 @@ public class Holder
public IFormattable Value;
}
""";
- SyntaxTree tree = CSharpSyntaxTree.ParseText(source, cancellationToken: TestContext.Current.CancellationToken);
+ SyntaxTree tree = CSharpSyntaxTree.ParseText(source, cancellationToken: cancellationToken);
CSharpCompilation compilation = CSharpCompilation.Create(
"TestAssembly",
[tree,],
@@ -53,11 +54,11 @@ public class Holder
],
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
SemanticModel model = compilation.GetSemanticModel(tree);
- FieldDeclarationSyntax declaration = tree.GetRoot(TestContext.Current.CancellationToken).DescendantNodes()
+ FieldDeclarationSyntax declaration = tree.GetRoot(cancellationToken).DescendantNodes()
.OfType()
.First();
VariableDeclaratorSyntax variable = declaration.Declaration.Variables.Single();
- IFieldSymbol fieldSymbol = (IFieldSymbol)model.GetDeclaredSymbol(variable, TestContext.Current.CancellationToken)!;
+ IFieldSymbol fieldSymbol = (IFieldSymbol)model.GetDeclaredSymbol(variable, cancellationToken)!;
ITypeSymbol typeSymbol = fieldSymbol.Type;
Type type = Type.From(typeSymbol);
diff --git a/Tests/Mockolate.SourceGenerators.Tests/GeneralTests.cs b/Tests/Mockolate.SourceGenerators.Tests/GeneralTests.cs
index 4b9b4e91b..b8271f434 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/GeneralTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/GeneralTests.cs
@@ -9,7 +9,7 @@ namespace Mockolate.SourceGenerators.Tests;
public class GeneralTests
{
- [Fact]
+ [Test]
public async Task AllGeneratedSourcesShouldContainAutoGeneratedTag()
{
GeneratorResult result = Generator
@@ -53,7 +53,7 @@ await That(result.Sources.Values).All()
.Satisfy(x => x!.Contains("") && x.Contains(""));
}
- [Fact]
+ [Test]
public async Task Constructor_WithRegistrationsParameter_ShouldRenameAdditionalParameter()
{
GeneratorResult result = Generator
@@ -93,7 +93,7 @@ public MyClass(global::Mockolate.MockRegistry mockRegistry_1, int mockRegistry)
""");
}
- [Fact]
+ [Test]
public async Task InterfaceProperty_ShouldNotRecursivelyCreateMocks()
{
GeneratorResult result = Generator
@@ -135,7 +135,7 @@ await That(result.Sources)
.DoesNotContainKey("Mock.IMyInterface3.g.cs");
}
- [Fact]
+ [Test]
public async Task MockOfGenericTypes_ShouldHandleSpecialGenericParameters()
{
GeneratorResult result = Generator
@@ -223,7 +223,7 @@ await That(result.Sources["Mock.IMyInterface_decimal.g.cs"])
.Contains("public global::System.Collections.Generic.IEnumerable MyEnumerable");
}
- [Fact]
+ [Test]
public async Task MockOfHttpMessageHandler_ShouldContainGetEnumeratorFromIEnumerableAndIEnumerableOfT()
{
GeneratorResult result = Generator
@@ -250,7 +250,7 @@ await That(result.Sources["Mock.HttpMessageHandler.g.cs"])
.DoesNotContain("void Dispose()");
}
- [Fact]
+ [Test]
public async Task MockOfIList_ShouldContainGetEnumeratorFromIEnumerableAndIEnumerableOfT()
{
GeneratorResult result = Generator
@@ -277,7 +277,7 @@ await That(result.Sources["Mock.IList_int.g.cs"])
.Contains("public global::System.Collections.Generic.IEnumerator GetEnumerator()");
}
- [Fact]
+ [Test]
public async Task MockOfIList_ShouldIncludeFullNameAsGenericParameter()
{
GeneratorResult result = Generator
@@ -311,7 +311,7 @@ internal class IList_MyRecord :
""");
}
- [Fact]
+ [Test]
public async Task MockOfTypesWithGenericTypes_ShouldHandleSpecialGenericParameters()
{
GeneratorResult result = Generator
@@ -371,7 +371,7 @@ await That(result.Sources["Mock.IMyInterface.g.cs"])
.Contains("public global::System.Collections.Generic.IEnumerable EnumerableOfDecimal");
}
- [Fact]
+ [Test]
public async Task MultipleInterfacesWithSameName_ShouldAddSuffixToSetupAndVerifyMethods()
{
GeneratorResult result = Generator
@@ -424,7 +424,7 @@ await That(result.Sources).ContainsKey("Mock.IMyInterface__IMyInterface__IMyInte
.Contains("global::MyCode.N2.IMyInterface, IMockForIMyInterface_2, IMockSetupForIMyInterface_2, IMockVerifyForIMyInterface_2");
}
- [Fact]
+ [Test]
public async Task ObsoleteAttributes_ShouldBeRepeatedInMock()
{
GeneratorResult result = Generator
@@ -505,7 +505,7 @@ public override int SomeMethod()
""").IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task SameMethodInMultipleInterfaces_ShouldUseExplicitImplementation()
{
GeneratorResult result = Generator
@@ -545,7 +545,7 @@ await That(result.Sources["Mock.IMyInterface1__IMyInterface2.g.cs"])
.Contains("void global::MyCode.IMyInterface2.MyMethod(int v1)");
}
- [Fact]
+ [Test]
public async Task SameMethodInNestedInterfaces_ShouldUseExplicitImplementation()
{
GeneratorResult result = Generator
@@ -584,7 +584,7 @@ await That(result.Sources["Mock.IMyInterface1.g.cs"])
.Contains("void global::MyCode.IMyInterface2.MyMethod(int v1)");
}
- [Fact]
+ [Test]
public async Task WhenClassHasFieldNamedMockRegistry_ShouldFallBackToAlternative()
{
GeneratorResult result = Generator
@@ -618,7 +618,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
"a mock subclass declaring a property `MockRegistry` would hide the inherited field (CS0108), so the dedup pipeline must skip past the conflicting member name");
}
- [Fact]
+ [Test]
public async Task WhenClassHasNestedTypeNamedMockRegistry_ShouldFallBackToAlternative()
{
GeneratorResult result = Generator
@@ -650,7 +650,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenInterfaceHasMethodNamedMock_ExtensionMockPropertyShouldBeRenamed()
{
GeneratorResult result = Generator
@@ -681,7 +681,7 @@ await That(result.Sources["Mock.IMyInterface.g.cs"])
"`Mock` is a method on the type, so the extension `Mock` property would shadow access and CreateUniquePropertyName must skip past it to a Mockolate_-prefixed alternative");
}
- [Fact]
+ [Test]
public async Task WhenInterfaceHasMockAndMockolate_MockProperties_ShouldUseMockolate_Mock__1ForMockAccessProperty()
{
GeneratorResult result = Generator
@@ -711,7 +711,7 @@ await That(result.Sources["Mock.IMyInterface.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenInterfaceHasMockMockolate_MockAndMockolate_Mock__1Properties_ShouldUseMockolate_Mock__2()
{
GeneratorResult result = Generator
@@ -742,7 +742,7 @@ await That(result.Sources["Mock.IMyInterface.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenInterfaceMembersOccupyAllMockRegistryNameCandidates_ShouldUseMockRegistry_2()
{
GeneratorResult result = Generator
@@ -776,7 +776,7 @@ await That(result.Sources["Mock.IMyInterface.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WithAttributes_ShouldAddAttributesToGeneratedCode()
{
GeneratorResult result = Generator
diff --git a/Tests/Mockolate.SourceGenerators.Tests/IndexerSetupsTests.cs b/Tests/Mockolate.SourceGenerators.Tests/IndexerSetupsTests.cs
index efa2477e3..7f3a1c9e5 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/IndexerSetupsTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/IndexerSetupsTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.SourceGenerators.Tests;
public sealed class IndexerSetupsTests
{
- [Fact]
+ [Test]
public async Task GenerateIndexerSetupsForIndexersWithMoreParameters()
{
GeneratorResult result = Generator
@@ -37,7 +37,7 @@ await That(result.Sources["IndexerSetups.g.cs"])
"internal class IndexerSetup(global::Mockolate.MockRegistry mockRegistry, global::Mockolate.Parameters.IParameterMatch parameter1, global::Mockolate.Parameters.IParameterMatch parameter2, global::Mockolate.Parameters.IParameterMatch parameter3, global::Mockolate.Parameters.IParameterMatch parameter4, global::Mockolate.Parameters.IParameterMatch parameter5) : global::Mockolate.Setup.IndexerSetup(mockRegistry)");
}
- [Fact]
+ [Test]
public async Task WhenAllIndexersHaveUpTo4Parameters_ShouldNotGenerateIndexerSetups()
{
GeneratorResult result = Generator
@@ -70,7 +70,7 @@ public interface IMyInterface
await That(result.Sources).DoesNotContainKey("IndexerSetups.g.cs");
}
- [Fact]
+ [Test]
public async Task WithComplexIndexer_ShouldOnlyGenerateNecessaryExtensions()
{
GeneratorResult result = Generator
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MethodSetupsTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MethodSetupsTests.cs
index b2e438c67..9673b09a6 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MethodSetupsTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MethodSetupsTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.SourceGenerators.Tests;
public sealed class MethodSetupsTests
{
- [Fact]
+ [Test]
public async Task GenerateMethodSetupsForMethodsWithMoreParameters()
{
GeneratorResult result = Generator
@@ -43,7 +43,7 @@ await That(result.Sources["MethodSetups.g.cs"])
"internal abstract class VoidMethodSetup : global::Mockolate.Setup.MethodSetup");
}
- [Fact]
+ [Test]
public async Task WhenAllMethodsHaveUpTo4Parameters_ShouldNotGenerateMethodSetups()
{
GeneratorResult result = Generator
@@ -74,8 +74,8 @@ public interface IMyInterface
await That(result.Sources).DoesNotContainKey("MethodSetups.g.cs");
}
- [Theory]
- [InlineData(
+ [Test]
+ [Arguments(
"""
string ToString();
bool Equals(object? obj);
@@ -84,43 +84,43 @@ public interface IMyInterface
"public override string ToString()",
"public override int GetHashCode()",
"public override bool Equals(object? obj)")]
- [InlineData(
+ [Arguments(
"""
bool Equals(object obj);
int GetHashCode();
""",
"public override bool Equals(object obj)",
"public override int GetHashCode()")]
- [InlineData(
+ [Arguments(
"""
string ToString();
int GetHashCode();
""",
"public override string ToString()",
"public override int GetHashCode()")]
- [InlineData(
+ [Arguments(
"""
string ToString();
bool Equals(object obj);
""",
"public override string ToString()",
"public override bool Equals(object obj)")]
- [InlineData(
+ [Arguments(
"""
string ToString();
""",
"public override string ToString()")]
- [InlineData(
+ [Arguments(
"""
bool Equals(object obj);
""",
"public override bool Equals(object obj)")]
- [InlineData(
+ [Arguments(
"""
bool Equals(object? obj);
""",
"public override bool Equals(object? obj)")]
- [InlineData(
+ [Arguments(
"""
int GetHashCode();
""",
@@ -156,7 +156,7 @@ public interface IMyInterface
}
}
- [Fact]
+ [Test]
public async Task WithComplexMethodReturningAValue_ShouldOnlyGenerateNecessaryExtensions()
{
GeneratorResult result = Generator
@@ -191,7 +191,7 @@ await That(result.Sources["MethodSetups.g.cs"])
.DoesNotContain("class ReturnMethodSetup");
}
- [Fact]
+ [Test]
public async Task WithComplexMethodReturningVoid_ShouldOnlyGenerateNecessaryExtensions()
{
GeneratorResult result = Generator
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MockBehaviorExtensionsTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MockBehaviorExtensionsTests.cs
index 4e52b8c4a..602b184fc 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MockBehaviorExtensionsTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MockBehaviorExtensionsTests.cs
@@ -4,7 +4,7 @@ namespace Mockolate.SourceGenerators.Tests;
public sealed class MockBehaviorExtensionsTests
{
- [Fact]
+ [Test]
public async Task DefaultValueGenerator_ForValueTuples_ShouldEmitInlineExpressions()
{
GeneratorResult result = Generator
@@ -47,7 +47,7 @@ await That(result.Sources["MockBehaviorExtensions.g.cs"])
.DoesNotContain("Generate");
}
- [Fact]
+ [Test]
public async Task DefaultValueGenerator_ShouldRegisterArrays()
{
GeneratorResult result = Generator
@@ -94,7 +94,7 @@ public T[] Generate(T[] nullValue, params object?[] parameters)
""").IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task DefaultValueGenerator_ShouldRegisterIEnumerables()
{
GeneratorResult result = Generator
@@ -134,7 +134,7 @@ await That(result.Sources["MockBehaviorExtensions.g.cs"])
""").IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task DefaultValueGenerator_ShouldRegisterTasks()
{
GeneratorResult result = Generator
@@ -180,7 +180,7 @@ await That(result.Sources["MockBehaviorExtensions.g.cs"])
.DoesNotContain("global::System.Func");
}
- [Fact]
+ [Test]
public async Task DefaultValueGenerator_ShouldRegisterValueTasks()
{
GeneratorResult result = Generator
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.AggregationTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.AggregationTests.cs
index 412de3474..13a09040c 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.AggregationTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.AggregationTests.cs
@@ -5,7 +5,7 @@ namespace Mockolate.SourceGenerators.Tests;
public sealed class MockGeneratorAggregationTests
{
- [Fact]
+ [Test]
public async Task AllVoidMethods_ShouldNotEmitReturnsThrowsAsyncExtensions()
{
GeneratorResult result = Generator
@@ -32,7 +32,7 @@ public interface IService
await That(result.Sources).DoesNotContainKey("ReturnsThrowsAsyncExtensions.g.cs");
}
- [Fact]
+ [Test]
public async Task AsExtensionsForChainOfTwoAdditionalInterfaces_ShouldEmitBothPairs()
{
// Implementing().Implementing() must register two pairs in Mock.AsExtensions.g.cs:
@@ -68,7 +68,7 @@ await That(result.Sources["Mock.AsExtensions.g.cs"])
.Contains("internal static partial class MockExtensionsForIA");
}
- [Fact]
+ [Test]
public async Task HttpClientMock_ShouldEmitHttpResponseMessageFactoryInBehaviorExtensions()
{
GeneratorResult result = Generator
@@ -93,7 +93,7 @@ await That(result.Sources["MockBehaviorExtensions.g.cs"])
.Contains("new HttpResponseMessageFactory(global::System.Net.HttpStatusCode.NotImplemented)");
}
- [Fact]
+ [Test]
public async Task NonHttpClientMock_ShouldNotEmitHttpResponseMessageFactoryInBehaviorExtensions()
{
GeneratorResult result = Generator
@@ -121,7 +121,7 @@ await That(result.Sources["MockBehaviorExtensions.g.cs"])
.DoesNotContain("HttpResponseMessageFactory");
}
- [Fact]
+ [Test]
public async Task NonVoidMethodWithArity5_ShouldEmitReturnsThrowsAsyncExtensions()
{
GeneratorResult result = Generator
@@ -147,7 +147,7 @@ public interface IService
await That(result.Sources).ContainsKey("ReturnsThrowsAsyncExtensions.g.cs");
}
- [Fact]
+ [Test]
public async Task SameRootWithDifferentAdditionalImplementations_ShouldEmitBothCombinations()
{
// Two MockClass entries have identical ClassFullName (IBase) but different
@@ -179,7 +179,7 @@ await That(result.Sources)
.ContainsKey("Mock.IBase__IExtraB.g.cs");
}
- [Fact]
+ [Test]
public async Task TwoCombinationsWithCollidingCombinedName_ShouldSuffixSecondCombination()
{
// Each combination resolves to combinedName "IBase__IExtra" because GetClassNameWithoutDots
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.EqualityTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.EqualityTests.cs
index 937bb2255..dc58b8bbb 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.EqualityTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MockGenerator.EqualityTests.cs
@@ -14,7 +14,7 @@ public sealed class MockGeneratorEqualityTests
{
public sealed class RefStructAggregateTests
{
- [Fact]
+ [Test]
public async Task Equals_WithDifferentType_IsFalse()
{
RefStructAggregate a = new(
@@ -25,7 +25,7 @@ public async Task Equals_WithDifferentType_IsFalse()
await That(a.Equals("not an aggregate")).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WithDifferingIndexerSetups_IsFalse()
{
RefStructAggregate a = new(
@@ -38,7 +38,7 @@ public async Task Equals_WithDifferingIndexerSetups_IsFalse()
await That(a.Equals(b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WithDifferingMethodSetups_IsFalse()
{
RefStructAggregate a = new(
@@ -52,7 +52,7 @@ public async Task Equals_WithDifferingMethodSetups_IsFalse()
await That(a.Equals((object)b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WithEqualMethodAndIndexerSetups_IsTrue()
{
RefStructAggregate a = new(
@@ -67,7 +67,7 @@ public async Task Equals_WithEqualMethodAndIndexerSetups_IsTrue()
await That(a.GetHashCode()).IsEqualTo(b.GetHashCode());
}
- [Fact]
+ [Test]
public async Task Equals_WithNull_IsFalse()
{
RefStructAggregate a = new(
@@ -81,7 +81,7 @@ public async Task Equals_WithNull_IsFalse()
public sealed class NamedMockTests
{
- [Fact]
+ [Test]
public async Task Equals_WhenAdditionalClassesDiffer_IsFalse()
{
MockClass mc = CreateMockClass();
@@ -93,7 +93,7 @@ public async Task Equals_WhenAdditionalClassesDiffer_IsFalse()
await That(a.Equals(b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WhenAdditionalClassesPresentOnOneAndNullOnOther_IsFalse()
{
MockClass mc = CreateMockClass();
@@ -105,7 +105,7 @@ public async Task Equals_WhenAdditionalClassesPresentOnOneAndNullOnOther_IsFalse
await That(withNull.Equals(withAdditional)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WhenBothAdditionalClassesNull_IsTrue()
{
MockClass mc = CreateMockClass();
@@ -115,7 +115,7 @@ public async Task Equals_WhenBothAdditionalClassesNull_IsTrue()
await That(a.Equals(b)).IsTrue();
}
- [Fact]
+ [Test]
public async Task Equals_WithDifferentFileName_IsFalse()
{
MockClass mc = CreateMockClass();
@@ -125,7 +125,7 @@ public async Task Equals_WithDifferentFileName_IsFalse()
await That(a.Equals(b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WithDifferentMockClass_IsFalse()
{
MockClass mcA = CreateMockClass();
@@ -138,7 +138,7 @@ public async Task Equals_WithDifferentMockClass_IsFalse()
await That(a.Equals(b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WithDifferentParentName_IsFalse()
{
MockClass mc = CreateMockClass();
@@ -148,7 +148,7 @@ public async Task Equals_WithDifferentParentName_IsFalse()
await That(a.Equals(b)).IsFalse();
}
- [Fact]
+ [Test]
public async Task Equals_WithIdenticalNamedMock_IsTrue()
{
MockClass mc = CreateMockClass();
@@ -160,7 +160,7 @@ public async Task Equals_WithIdenticalNamedMock_IsTrue()
await That(a.GetHashCode()).IsEqualTo(b.GetHashCode());
}
- [Fact]
+ [Test]
public async Task Equals_WithNullOther_IsFalse()
{
MockClass mc = CreateMockClass();
@@ -170,7 +170,7 @@ public async Task Equals_WithNullOther_IsFalse()
await That(a!.Equals((object?)null)).IsFalse();
}
- [Fact]
+ [Test]
public async Task GetHashCode_IncludesAdditionalClasses()
{
MockClass mc = CreateMockClass();
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MockGeneratorTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MockGeneratorTests.cs
index 13fa5061b..ea6b81863 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MockGeneratorTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MockGeneratorTests.cs
@@ -7,7 +7,7 @@ namespace Mockolate.SourceGenerators.Tests;
public partial class MockGeneratorTests
{
- [Fact]
+ [Test]
public async Task SameMethodDifferingOnlyByNullability_ShouldUseExplicitImplementationForConflictingInterface()
{
GeneratorResult result = Generator
@@ -44,7 +44,7 @@ await That(result.Sources["Mock.IInterface1__IInterface2.g.cs"])
.Contains("void global::MyCode.IInterface2.Method(string value)");
}
- [Fact]
+ [Test]
public async Task SealedClass_ShouldNotBeIncluded()
{
GeneratorResult result = Generator
@@ -74,7 +74,7 @@ await ThatAll(
);
}
- [Fact]
+ [Test]
public async Task WhenClassHasConstructorWithParameters_ShouldGenerateTypedCreateMockOverload()
{
GeneratorResult result = Generator
@@ -113,7 +113,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenClassHasMultipleConstructors_ShouldGenerateTypedOverloadPerConstructor()
{
GeneratorResult result = Generator
@@ -147,7 +147,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenClassHasOnlyParameterlessConstructor_ShouldNotEmitAdditionalTypedOverloads()
{
GeneratorResult result = Generator
@@ -176,7 +176,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
"the hand-written parameterless CreateMock() overload is still emitted, and no typed overload is added beyond it");
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasCharDefault_ShouldEscapeInTypedOverload()
{
GeneratorResult result = Generator
@@ -206,7 +206,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasDecimalDefault_ShouldAppendMSuffixInTypedOverload()
{
GeneratorResult result = Generator
@@ -236,7 +236,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasEnumDefault_ShouldCastToFullyQualifiedEnumTypeInTypedOverload()
{
GeneratorResult result = Generator
@@ -268,7 +268,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasFloatDefault_ShouldAppendFSuffixInTypedOverload()
{
GeneratorResult result = Generator
@@ -298,7 +298,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasInParameter_ShouldNotEmitTypedOverload()
{
GeneratorResult result = Generator
@@ -331,7 +331,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasLongAndDoubleDefaults_ShouldPreserveLiteralsInTypedOverload()
{
GeneratorResult result = Generator
@@ -361,7 +361,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasNullableDecimalDefault_ShouldAppendMSuffixInTypedOverload()
{
GeneratorResult result = Generator
@@ -392,7 +392,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasNullableReferenceDefaultNull_ShouldEmitNullLiteralInTypedOverload()
{
GeneratorResult result = Generator
@@ -423,7 +423,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasRefOrParamsParameter_ShouldNotEmitTypedOverload()
{
GeneratorResult result = Generator
@@ -455,7 +455,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasStringDefaultWithQuotes_ShouldEscapeInTypedOverload()
{
GeneratorResult result = Generator
@@ -485,7 +485,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorHasValueTypeDefaultNull_ShouldEmitDefaultInTypedOverload()
{
GeneratorResult result = Generator
@@ -517,7 +517,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterIsMockBehavior_ShouldNotEmitAmbiguousTypedOverload()
{
GeneratorResult result = Generator
@@ -547,7 +547,7 @@ await That(matches).IsEqualTo(1)
"the hand-written CreateMock(MockBehavior) overload already covers this signature, so a typed single-parameter overload would produce a duplicate definition");
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterIsUnrelatedAction_ShouldEmitTypedOverload()
{
GeneratorResult result = Generator
@@ -581,7 +581,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
"Action does not collide with the setup action type (Action)");
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterTypeIsProtectedInternalNestedType_ShouldEmitConstructor()
{
GeneratorResult result = Generator
@@ -613,7 +613,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.Because("the internal half of `protected internal` is visible within the declaring assembly");
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterTypeIsProtectedNestedType_ShouldNotEmitConstructor()
{
GeneratorResult result = Generator
@@ -647,7 +647,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
"a protected nested type is only reachable through inheritance, so naming it on the generated public constructor (CS0051) or in MockExtensionsForMyService (CS0122) would not compile");
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterTypeIsProtectedNestedTypeArgument_ShouldNotEmitConstructor()
{
GeneratorResult result = Generator
@@ -681,7 +681,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.Because("an inaccessible type is equally unusable when composed into an array or a type argument");
}
- [Fact]
+ [Test]
public async Task WhenOnlyConstructorHasProtectedNestedParameterType_ShouldNotGenerateMock()
{
GeneratorResult result = Generator
@@ -709,7 +709,7 @@ await That(result.Sources).DoesNotContainKey("Mock.MyService.g.cs")
.Because("no constructor remains that the generated mock could invoke");
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterTypeNestsInProtectedTypeArgumentOfContainingType_ShouldNotEmitConstructor()
{
GeneratorResult result = Generator
@@ -747,7 +747,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
"`Wrapper.Inner` carries the type argument on its containing type, so checking only the innermost type's arguments would let the inaccessible type through");
}
- [Fact]
+ [Test]
public async Task WhenConstructorParameterTypeIsInternalInSameAssembly_ShouldEmitConstructor()
{
GeneratorResult result = Generator
@@ -780,7 +780,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.Because("the generated mock lives in the same assembly, so an internal parameter type is nameable");
}
- [Fact]
+ [Test]
public async Task WhenVirtualMemberSignatureUsesProtectedNestedType_ShouldNotMockMember()
{
GeneratorResult result = Generator
@@ -819,7 +819,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
"the setup and verify surfaces restate the signature verbatim but do not derive from the mocked type, so a protected nested type would cause CS0122 there");
}
- [Fact]
+ [Test]
public async Task WhenVirtualEventTypeUsesProtectedNestedType_ShouldNotMockEvent()
{
GeneratorResult result = Generator
@@ -852,7 +852,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.Because("the raise surface names the delegate type verbatim");
}
- [Fact]
+ [Test]
public async Task WhenAbstractMemberSignatureUsesProtectedNestedType_ShouldNotGenerateMock()
{
GeneratorResult result = Generator
@@ -880,12 +880,12 @@ await That(result.Sources).DoesNotContainKey("Mock.MyService.g.cs")
.Because("the member must be implemented, but the mock cannot restate its signature");
}
- [Theory]
- [InlineData("protected abstract void Consume(Configuration configuration);",
+ [Test]
+ [Arguments("protected abstract void Consume(Configuration configuration);",
"protected override void Consume(Configuration configuration) { }")]
- [InlineData("protected abstract Configuration Current { get; set; }",
+ [Arguments("protected abstract Configuration Current { get; set; }",
"protected override Configuration Current { get; set; }")]
- [InlineData("protected abstract event Handler Changed;",
+ [Arguments("protected abstract event Handler Changed;",
"protected override event Handler Changed; protected void Fire() => Changed?.Invoke();")]
public async Task WhenAbstractMemberWithInaccessibleSignatureIsAlreadyOverridden_ShouldGenerateMock(
string baseMember, string derivedOverride)
@@ -925,7 +925,7 @@ await That(result.Sources["Mock.Derived.g.cs"])
.DoesNotContain("Handler");
}
- [Fact]
+ [Test]
public async Task WhenConstructorsDifferOnlyByNullableValueType_ShouldEmitBothTypedOverloads()
{
GeneratorResult result = Generator
@@ -960,7 +960,7 @@ await That(result.Sources["Mock.MyService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenDerivedClassHasBaseClassConstructorParameters_ShouldEmitTypedOverloadForDerived()
{
GeneratorResult result = Generator
@@ -995,7 +995,7 @@ await That(result.Sources["Mock.DerivedService.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenGenericClassHasTypedConstructor_ShouldEmitTypedOverloadForClosedType()
{
GeneratorResult result = Generator
@@ -1027,7 +1027,7 @@ await That(generated)
"the mock for the closed generic MyService must carry the typed overload with the substituted type argument");
}
- [Fact]
+ [Test]
public async Task WhenImplementingAdditionalClass_ShouldCreateCombinationMock()
{
GeneratorResult result = Generator
@@ -1067,7 +1067,7 @@ await That(result.Sources.Keys).IsEqualTo([
]).InAnyOrder();
}
- [Fact]
+ [Test]
public async Task WhenImplementingAdditionalInterface_WithBaseClassHavingOptionalConstructorParameter_ShouldGenerateTryCastWithDefaultValue()
{
GeneratorResult result = Generator
@@ -1105,7 +1105,7 @@ await That(result.Sources["Mock.MyService__IMyInterface.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenImplementingAdditionalInterface_WithBaseClassHavingRequiredConstructorParameter_ShouldGenerateTryCast()
{
GeneratorResult result = Generator
@@ -1147,7 +1147,7 @@ await That(result.Sources["Mock.MyService__IMyInterface.g.cs"])
.IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task WhenMethodContainsMoreThan16Parameters_ShouldAddCustomAction()
{
GeneratorResult result = Generator
@@ -1183,7 +1183,7 @@ await That(result.Sources["ActionFunc.g.cs"])
"public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16, T17 arg17);");
}
- [Fact]
+ [Test]
public async Task WhenNamesConflict_ShouldBeDistinguishable()
{
GeneratorResult result = Generator
@@ -1226,7 +1226,7 @@ await ThatAll(
);
}
- [Fact]
+ [Test]
public async Task WhenNamesConflictForAdditionalClasses_ShouldBeDistinguishable()
{
GeneratorResult result = Generator
@@ -1273,7 +1273,7 @@ await ThatAll(
);
}
- [Fact]
+ [Test]
public async Task WhenNamesConflictForAdditionalClassesInDifferentNamespaces_ShouldBeDistinguishable()
{
GeneratorResult result = Generator
@@ -1322,7 +1322,7 @@ await ThatAll(
);
}
- [Fact]
+ [Test]
public async Task WhenOneCtorStartsWithMockBehaviorAndAnotherOmitsIt_ShouldNotEmitDuplicateTypedOverloads()
{
// Two constructors that could produce the same C# signature after the generator's
@@ -1357,7 +1357,7 @@ public MyService(int value) { }
await That(matches).IsEqualTo(1);
}
- [Fact]
+ [Test]
public async Task WhenSameCombinationIsDeclaredTwice_ShouldDeduplicateToSingleEmittedFile()
{
// Same root mock with the same .Implementing() chain in different call sites must
@@ -1390,7 +1390,7 @@ public interface IMyExtra { }
await That(combinationKeys).IsEqualTo(["Mock.IMyService__IMyExtra.g.cs",]).InAnyOrder();
}
- [Fact]
+ [Test]
public async Task WhenSameMethodInTwoInterfacesDiffersOnlyInRefKind_ShouldUseExplicitImplementation()
{
// Two interfaces declare a method with the same name and parameter type but different
@@ -1430,7 +1430,7 @@ await That(result.Sources["Mock.IInterface1__IInterface2.g.cs"])
.Contains("void global::MyCode.IInterface2.Method(in int value)");
}
- [Fact]
+ [Test]
public async Task WhenSameMockIsDeclaredTwice_ShouldDeduplicateToSingleEmittedFile()
{
// Two identical Mock.Create() declarations must collapse to a single emitted
@@ -1465,7 +1465,7 @@ public interface IMyInterface
await That(interfaceMockKeys).IsEqualTo(["Mock.IMyInterface.g.cs",]).InAnyOrder();
}
- [Fact]
+ [Test]
public async Task WhenSameTypeImplementsDifferentCombinationsOfSameInterface_ShouldGenerateAllCombinations()
{
GeneratorResult result = Generator
@@ -1504,7 +1504,7 @@ await That(result.Sources)
.ContainsKey("Mock.IBaseInterface__IAdditionalInterface1.g.cs");
}
- [Fact]
+ [Test]
public async Task WhenTypedCreateMockOverloadIsEmitted_ConstructorCrefShouldResolve()
{
const string expectedCref = "global::MyCode.MyService(int, string)";
@@ -1542,7 +1542,7 @@ await That(crefFailures).IsEmpty()
"CS1574/CS1584/CS1658 messages embed the offending cref text, so a cref that resolves cleanly under DocumentationMode.Diagnose is mentioned by no diagnostic");
}
- [Fact]
+ [Test]
public async Task WhenTypedCreateMockOverloadIsEmittedForExternalType_ConstructorCrefShouldResolve()
{
GeneratorResult result = Generator
@@ -1574,7 +1574,7 @@ await That(result.Sources["Mock.HttpClient.g.cs"])
await That(crefFailures).IsEmpty();
}
- [Fact]
+ [Test]
public async Task WhenTypedCreateMockOverloadIsEmittedForGenericClass_ShouldNotEmitConstructorCref()
{
GeneratorResult result = Generator
@@ -1607,7 +1607,7 @@ await That(result.Sources["Mock.MyService_int.g.cs"])
"closed-generic constructor crefs (e.g. MyService{int}.MyService(int)) aren't valid C# cref syntax, so generic classes fall back to the unlinked phrasing rather than surface CS1584 on the consumer side");
}
- [Fact]
+ [Test]
public async Task WhenUsingCreateMockFromNonMockolateNamespace_ShouldNotBeIncluded()
{
GeneratorResult result = Generator
@@ -1648,7 +1648,7 @@ await ThatAll(
);
}
- [Fact]
+ [Test]
public async Task WhenUsingSetups_ShouldGenerateMocksAndExtensions()
{
GeneratorResult result = Generator
@@ -1678,7 +1678,7 @@ public interface IMyInterface
await That(result.Sources).ContainsKey("Mock.IMyInterface.g.cs");
}
- [Fact]
+ [Test]
public async Task WithClassAsAdditionalImplementation_ShouldNotThrow()
{
GeneratorResult result = Generator
@@ -1715,7 +1715,7 @@ await That(result.Sources.Keys).IsEqualTo([
]).InAnyOrder();
}
- [Fact]
+ [Test]
public async Task WithHttpClient_ShouldAlsoGenerateMockForHttpMessageHandler()
{
GeneratorResult result = Generator
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.EventsTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.EventsTests.cs
index 45e4d4544..bb673ca54 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.EventsTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.EventsTests.cs
@@ -6,7 +6,7 @@ public sealed partial class ClassTests
{
public sealed class EventsTests
{
- [Fact]
+ [Test]
public async Task EventWithRefOutDelegate_ShouldPreserveModifiersOnRaise()
{
GeneratorResult result = Generator
@@ -33,7 +33,7 @@ public interface IMyService
await That(result.Diagnostics).IsEmpty();
}
- [Fact]
+ [Test]
public async Task MultipleImplementations_ShouldOnlyHaveOneExplicitImplementation()
{
GeneratorResult result = Generator
@@ -73,7 +73,7 @@ await That(result.Sources["Mock.IMyService__IMyServiceBase1__IMyServiceBase2.g.c
.Contains("event global::System.EventHandler? global::MyCode.IMyServiceBase2.SomeEvent").Once();
}
- [Fact]
+ [Test]
public async Task ShouldGenerateEventSetupInSetupInterface()
{
GeneratorResult result = Generator
@@ -119,7 +119,7 @@ await That(result.Sources["Mock.IMyService.g.cs"])
""").IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task ShouldImplementAllEventsFromInterfaces()
{
GeneratorResult result = Generator
@@ -209,7 +209,7 @@ await That(result.Sources["Mock.IMyService.g.cs"])
""").IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task ShouldImplementImplicitlyInheritedEvents()
{
GeneratorResult result = Generator
@@ -375,7 +375,7 @@ await That(result.Sources["Mock.IMyService.g.cs"])
""").IgnoringNewlineStyle();
}
- [Fact]
+ [Test]
public async Task ShouldImplementVirtualEventsOfClassesAndAllExplicitlyFromAdditionalInterfaces()
{
GeneratorResult result = Generator
diff --git a/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.IndexerTests.cs b/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.IndexerTests.cs
index 0881f16f1..4a232dbad 100644
--- a/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.IndexerTests.cs
+++ b/Tests/Mockolate.SourceGenerators.Tests/MockTests.ClassTests.IndexerTests.cs
@@ -6,43 +6,43 @@ public sealed partial class ClassTests
{
public sealed class IndexerTests
{
- [Theory]
- [InlineData("string this[int key] { get; }",
+ [Test]
+ [Arguments("string this[int key] { get; }",
"Setup.IIndexerGetterOnlySetup",
"Verify.VerificationIndexerGetterResult",
"Setup.IndexerSetup",
"Verify.VerificationIndexerResult")]
- [InlineData("string this[int key] { set; }",
+ [Arguments("string this[int key] { set; }",
"Setup.IIndexerSetterOnlySetup