Upgraded to .NET 10 (#1147)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-01 20:32:16 +01:00
1 parent faae2951f7
commit fc7399e81b
327 files changed
+3059 -3049

No files matched your search

@@ -51,12 +51,12 @@ public sealed class ModelPatternLiteralAnalyzerTests
{
var reported = await AnalyzeAsync(statements);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(reported, Has.Count.EqualTo(1));
Assert.That(reported.FirstOrDefault()?.Id, Is.EqualTo("MWAIS0013"));
Assert.That(reported.FirstOrDefault()?.GetMessage(), Does.Contain($"write it as \"{expectedSpelling}\""));
});
}
}
[Test]
@@ -64,11 +64,11 @@ public sealed class ModelPatternLiteralAnalyzerTests
{
var reported = await AnalyzeAsync("""builder.Rule("___");""");
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(reported, Has.Count.EqualTo(1));
Assert.That(reported.FirstOrDefault()?.GetMessage(), Does.Contain("nothing of it survives"));
});
}
}
[Test]
@@ -97,12 +97,12 @@ public sealed class ModelRegistryGeneratorTests
{
var generated = Generate(TWO_FAMILIES_AND_A_HOST, out _, out _);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(generated, Does.Contain("new global::Sample.FirstFamily()"));
Assert.That(generated, Does.Contain("new global::Sample.SecondFamily()"), "A family which inherits through another class is still a family.");
Assert.That(generated, Does.Contain("new global::Sample.SampleHost()"));
});
}
}
[Test]
@@ -142,11 +142,11 @@ public sealed class ModelRegistryGeneratorTests
//
var generated = Generate("namespace Sample;\n\npublic sealed class NothingToDoWithModels;", out var updated, out _);
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(generated, Does.Contain("public static class ModelRegistrations"));
Assert.That(CompilationHarness.ErrorsOf(updated), Is.Empty);
});
}
}
[Test]
@@ -155,12 +155,12 @@ public sealed class ModelRegistryGeneratorTests
var generated = Generate(A_FAMILY_NEEDING_AN_ARGUMENT, out _, out var diagnostics);
var reported = diagnostics.Where(diagnostic => diagnostic.Id is "MDR001").ToList();
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(reported, Has.Count.EqualTo(1));
Assert.That(reported.FirstOrDefault()?.GetMessage(), Does.Contain("DemandingFamily"));
Assert.That(generated, Does.Not.Contain("DemandingFamily"));
});
}
}
[Test]
@@ -170,11 +170,11 @@ public sealed class ModelRegistryGeneratorTests
// The tests above run the generator by hand. This one asks whether it also ran while the app
// was built, which is a different question and the one that actually matters.
//
Assert.Multiple(() =>
using (Assert.EnterMultipleScope())
{
Assert.That(ModelRegistrations.CreateFamilies(), Is.Not.Null);
Assert.That(ModelRegistrations.CreateHosts(), Is.Not.Null);
});
}
}
private static string Generate(string source, out Compilation updated, out IReadOnlyList<Diagnostic> diagnostics)