Skip to content

Move the GeneratorTests files A to M to DependencyModules.Specs - #137

Merged
ipjohnson merged 3 commits into
mainfrom
agent/stp-vgdm-generator-a-m
Nov 27, 2026
Merged

ipjohnson merged 3 commits into
mainfrom
agent/stp-vgdm-generator-a-m

Conversation

@ipjohnson

@ipjohnson ipjohnson commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

What changed

The 46 files in tests/DependencyModules.Tests/GeneratorTests from ApplicationModuleCollisionTests.cs to ModuleParameterAccessibilityTests.cs move to tests/DependencyModules.Specs/GeneratorTests. The 10 snapshots that they read (GlueFuncTests.* and ModuleGenerationSnapshotTests.*) move to tests/DependencyModules.Specs/Snapshots. The first commit only moves the files, so git keeps the history of each file. The second commit converts them.

  • [Fact] becomes [VerifyTest]. [Theory] with [InlineData] becomes [VerifyTest] with [Row], with the same values in the same order.
  • [MemberData] becomes [RowSource]. DiagnosticSuppressionTests.Triggers yields (string Code, string Source) tuples. ModelComparerTests.DifferingConfigurations yields (string, DependencyModuleConfigurationModel) tuples and sets DeterministicReplay = true, because a model value cannot give a row ID.
  • The Assert calls become Verify, Single, NotNull and ThrowsExactly. Assert.All becomes a foreach loop with Verify. A value typed object is compared with Equals, and a sequence is compared with SequenceEqual.
  • In ConventionContractTests, nameof(IConventionModule) == GeneratorNames.ConventionModule is a constant, and VG0002 reports that it checks nothing. The check now reads typeof(IConventionModule).Name.
  • GeneratorTestHarness.CompileLibrary returns the library that is already loaded when the name and the source are the same. The VerificationGlue.Tests runner runs the rows of one test at the same time. Before this change, two rows of EnvironmentAttributesFromSymbolsTests.ADecoratorFromAReferencedAssembly_KeepsItsEnvironmentAttribute each loaded a copy of EnvironmentDecoratorPackage. The second copy replaced the first in the assembly resolver, so the first row did not find its IGreeter service.

The branch merges main at 0158a19, which moved the N to Z files (#139). Both changes edited the same CONTRIBUTING.md sentence. The merged sentence says that tests/DependencyModules.Specs has the RuntimeTests, ApiTests and GeneratorTests folders, because no GeneratorTests file stays in tests/DependencyModules.Tests now.

Why

This step moves DependencyModules' own unit tests to the [VerifyTest] runner, so that a failed check shows its expression and the values in it.

How it was tested

  • Before the merge, I compared the old and new files. There are 548 [Fact] and 548 [VerifyTest] methods without rows, 171 [InlineData] and 171 [Row] attributes, and 3 member-data tests that give 18, 18 and 10 rows. I compared the --list-tests output of the Specs project with these counts for each method name, and they match: these files give 765 tests.
  • After the merge, dotnet exec on the Specs test application passed 1055 of 1055 tests in three runs in a row.
  • After the merge, ./scripts/coverage.sh 85 passed. It ran DependencyModules.Tests (131 of 131 on net8.0 and net10.0), the integration test projects, and the Specs project under coverlet. Line coverage is 92.8 percent.
  • After the merge, ./scripts/test-xunit.sh 4 passed. DependencyModules.Tests passed 132 of 132 on net8.0 and net10.0, and the Specs project passed 1055 of 1055.
  • dotnet csharpier check . passed.

I did not run ./scripts/verify-packages.sh, because this change does not touch the packages. The moved tests now run on net10.0 only, because the Specs project targets only net10.0. Before, they also ran on net8.0.

🤖 Generated with Claude Code


Opened by Agent Driver for step stp-vgdm-generator-a-m of Task tsk-verificationglue.

Agent Driver and others added 2 commits November 26, 2026 20:55
This commit only moves the files. The next commit converts them to
[VerifyTest], so git keeps the history of each file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Fact] becomes [VerifyTest], [Theory] with [InlineData] becomes [Row],
[MemberData] becomes [RowSource], and the Assert calls become Verify,
Single, NotNull and ThrowsExactly. Each test keeps its name, its rows
and its checks.

The VerificationGlue.Tests runner runs the rows of one test at the same
time. Two rows that compiled the same library loaded two copies of it,
and the second copy replaced the first in the assembly resolver. So
GeneratorTestHarness.CompileLibrary now returns the copy that is already
loaded for the same name and source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p-vgdm-generator-a-m

# Conflicts:
#	CONTRIBUTING.md
@ipjohnson
ipjohnson merged commit dc67863 into main Nov 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant