Repository navigation
Move the framework-free TestingTests to DependencyModules.Specs - #138
Merged
Merged
Conversation
Convert SharedRegistrationsTests, TestContainerSourceUnitTests, TestExportAttributeTests, TestOutputLoggerProviderTests and TestParameterResolverTests to [VerifyTest] with Row and Verify checks. TestContainerSourceTests stays in DependencyModules.Tests, because its tests run through [ModuleTest] and the xUnit integration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SetupServiceCollection keyed the value providers by the ParameterInfo objects of one GetParameters call, and ResolveArgumentsAsync looked them up with another. When tests run in parallel, two first calls on the same method can return different arrays, and the lookup throws KeyNotFoundException. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Commit 269bfea fixes the CI failure of Before the fix, the Specs project failed this test in 3 of 40 local runs. After it, 100 of 100 runs passed, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Five files move from
tests/DependencyModules.Tests/TestingTeststotests/DependencyModules.Specs/TestingTests. Each one now runs on the[VerifyTest]runner:SharedRegistrationsTests.cs(12 tests)TestContainerSourceUnitTests.cs(10 tests)TestExportAttributeTests.cs(10 tests, 3 of them rows)TestOutputLoggerProviderTests.cs(12 tests, 6 of them rows)TestParameterResolverTests.cs(15 tests)[Fact]is now[VerifyTest], and[Theory]with[InlineData]is now[VerifyTest]with[Row]. TheAssertcalls are nowVerify,Single,Is<T>,ThrowsExactlyandThrowsExactlyAsync, with the same forms that #136 used.Assert.IsType<T>is now aGetType() == typeof(T)check, so it stays an exact-type check. The classes arepartialand are in theDependencyModules.Specs.TestingTestsnamespace. All 59 tests still exist, with the same names.CONTRIBUTING.mdnow says thatTestingTestsis in the Specs project, and that some of its tests stay in the old project.Tests that stay on xUnit
tests/DependencyModules.Tests/TestingTests/TestContainerSourceTests.csstays in the old project. All of its tests are[ModuleTest]tests fromDependencyModules.xUnit. They testITestContainerSourceand[TestExport]sharing through the xUnit integration, so they need the xUnit runner:TestContainerSourceTests:ABareParameterIsTheSameObjectInEveryContainer,EachContainerGetsItsOwnApplicationSingleton,AMockIsTheSameObjectInEveryContainer,TheTestsOwnContainerHoldsTheSameMock,EveryCallBuildsAContainer,TheKeyedRegistrationsOfAPinnedTypeAreKept,SharedOnAValueParameterIsRedundantIsolatedTestExportTests:AnExportIsRebuiltWithEachContainerSharedTestExportTests:AnExportAskingToBeSharedCrossesEveryContainer,SharedOverridesATransientLifetimeUnsharableTestExportTests:ASharedExportTheTestsContainerCannotProduceIsReportedThis PR does not change
GeneratorTests.Why
DependencyModules' own unit tests are moving to the
[VerifyTest]runner, so that a failed check shows its expression and values. Only tests of the xUnit or NUnit integration stay on xUnit.How it was tested
dotnet build DependencyModules.sln --configuration Releasebuilds with no errors../scripts/coverage.sh 85passes.DependencyModules.Testspassed 1003 tests onnet8.0and onnet10.0.DependencyModules.Specspassed 183 tests. Line coverage is 92.8 percent../scripts/test-xunit.sh 4passes,DependencyModules.SpecswithXunitMajor=4included.--list-testson the Specs application lists 59 tests from the five moved classes. That is the count of[Fact]and[InlineData]rows in the old files.dotnet csharpier check .passes.🤖 Generated with Claude Code
Opened by Agent Driver for step
stp-vgdm-testing-testsof Tasktsk-verificationglue.