Move the test suite to MSTest 4 on Microsoft.Testing.Platform, with AwesomeAssertions - #118
Closed
JohnCampionJr wants to merge 1 commit into
Closed
JohnCampionJr wants to merge 1 commit into
JohnCampionJr wants to merge 1 commit into
Conversation
…wesomeAssertions Matching Porta.Pty's testing stack: MSTest 4.2.3 + AwesomeAssertions 9.4.0, the test project as an MTP executable (EnableMSTestRunner, TestingPlatformDotnetTestSupport), and a repo global.json pinning dotnet test to the Microsoft.Testing.Platform runner. Mechanics of the conversion, for the reviewer's map: - [Fact]/[Theory]/[InlineData]/[MemberData] became [TestMethod]/[DataRow]/[DynamicData]; TheoryData<> sources became IEnumerable<object[]>. DataRow is strict about argument types where xUnit coerced, so byte parameters carry (byte) casts in their rows. - xUnit Assert.* became AwesomeAssertions Should() forms. Scalars use Be/NotBe; collections use Equal/NotEqual (the two are not interchangeable, and the compiler plus a full run arbitrated every site). Assert.Throws<T> became MSTest's Assert.ThrowsExactly<T>, which keeps xUnit's exact-type semantics and its returned exception. - Assert.Contains(collection, predicate) has its arguments in the OPPOSITE order from Assert.Contains(item, collection); the predicate sites read naturally as collection.Should().Contain(predicate). - xUnit's Record.Exception has no MSTest counterpart; a five-line helper of the same name keeps those call sites reading unchanged. 2,037 tests before on xUnit, 2,037 after on MTP, zero failed, zero skipped -- exact parity. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JohnCampionJr
marked this pull request as draft
August 30, 2026 23:19
Collaborator
Author
|
Tabling this for now |
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.
Aligns the suite with the testing stack used in Porta.Pty: MSTest 4.2.3 + AwesomeAssertions 9.4.0 on Microsoft.Testing.Platform (test project as an MTP executable; repo
global.jsonpins thedotnet testrunner).Conversion map for review:
[Fact]/[Theory]/[InlineData]/[MemberData]→[TestMethod]/[DataRow]/[DynamicData];TheoryData<>sources →IEnumerable<object[]>.DataRowis strict where xUnit coerced, sobyteparameters carry casts in their rows.Assert.*→Should()forms — scalarsBe, collectionsEqual(not interchangeable; the compiler plus a full run arbitrated every site).Assert.Throws<T>→ MSTestAssert.ThrowsExactly<T>(same exact-type semantics, same returned exception).Record.Exceptionhas no MSTest counterpart; a five-line helper of the same name keeps those call sites unchanged.2,037 tests before on xUnit → 2,037 after on MTP, 0 failed, 0 skipped — exact parity.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com