Skip to content

Commit 39c9a65

Browse files
committed
remove shoudly
1 parent f2d9f95 commit 39c9a65

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

src/Directory.Packages.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<PackageVersion Include="Polyfill" Version="5.3.0" />
2626
<PackageVersion Include="ProjectDefaults" Version="1.0.127" />
2727
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
28-
<PackageVersion Include="Shouldly" Version="4.2.1" />
2928
<PackageVersion Include="SimpleInfoName" Version="2.2.0" />
3029
<PackageVersion Include="System.Drawing.Common" Version="8.0.6" />
3130
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
global using System.Collections.Immutable;
22
global using Microsoft.CodeAnalysis;
33
global using Microsoft.CodeAnalysis.CSharp;
4-
global using Shouldly;
54
global using VerifyMSTest.SourceGenerator;
65
global using Xunit.Abstractions;

src/Verify.MSTest.SourceGenerator.Tests/TestBase.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ public abstract class TestBase(ITestOutputHelper output)
55
private protected TestDriver TestDriver { get; } = new([new UsesVerifyGenerator().AsSourceGenerator()]);
66
protected ITestOutputHelper Output { get; } = output;
77

8-
private protected async Task VerifyGenerator(GeneratorDriverResults results, IEnumerable<string>? expectedDiagnostics = null)
8+
private protected async Task VerifyGenerator(GeneratorDriverResults results, IReadOnlyList<string>? expectedDiagnostics = null)
99
{
1010
var first = results.FirstRun;
1111
Output.WriteLine($"First run of generators took: {first.TimingInfo.ElapsedTime}");
1212
var cached = results.CachedRun;
1313
Output.WriteLine($"Cached re-run of generators took: {cached.TimingInfo.ElapsedTime}");
1414

15-
expectedDiagnostics ??= [];
16-
results.outputCompilation.GetDiagnostics().ShouldAllBe(_ => expectedDiagnostics.Contains(_.Id));
15+
if (expectedDiagnostics != null)
16+
{
17+
foreach (var diagnostic in results.outputCompilation.GetDiagnostics())
18+
{
19+
Assert.Contains(diagnostic.Id, expectedDiagnostics);
20+
}
21+
}
1722

1823
await Verify(first.RunResult.SelectGeneratedSources());
1924

@@ -22,22 +27,22 @@ private protected async Task VerifyGenerator(GeneratorDriverResults results, IEn
2227
var trackedSteps1 = first.RunResult.GetTrackedSteps(trackingNames);
2328
var trackedSteps2 = cached.RunResult.GetTrackedSteps(trackingNames);
2429

25-
trackedSteps2.Keys.ShouldBe(trackedSteps1.Keys);
30+
Assert.Equal(trackedSteps2.Keys, trackedSteps1.Keys);
2631
foreach (var (key, steps1) in trackedSteps1)
2732
{
2833
var steps2 = trackedSteps2[key];
2934

30-
steps2.Length.ShouldBe(steps1.Length);
35+
Assert.Equal(steps2.Length, steps1.Length);
3136
for (var i = 0; i < steps1.Length; i++)
3237
{
3338
var outputs1 = steps1[i].Outputs;
3439
var outputs2 = steps2[i].Outputs;
3540

36-
outputs1.Select(_ => _.Value)
37-
.ShouldBe(outputs2.Select(_ => _.Value));
38-
outputs2.Select(_ => _.Reason)
39-
.ShouldAllBe(_ => _ == IncrementalStepRunReason.Cached ||
40-
_ == IncrementalStepRunReason.Unchanged);
41+
Assert.Equal(outputs1.Select(_ => _.Value), outputs2.Select(_ => _.Value));
42+
foreach (var output in outputs2)
43+
{
44+
Assert.True(output.Reason is IncrementalStepRunReason.Cached or IncrementalStepRunReason.Unchanged);
45+
}
4146
}
4247
}
4348
}

src/Verify.MSTest.SourceGenerator.Tests/Verify.MSTest.SourceGenerator.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="MSTest.TestFramework" />
12-
<PackageReference Include="Shouldly" />
1312
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1413
<PackageReference Include="Xunit" />
1514
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />

0 commit comments

Comments
 (0)