Skip to content

Move the test suite to MSTest 4 on Microsoft.Testing.Platform, with AwesomeAssertions - #118

Closed
JohnCampionJr wants to merge 1 commit into
tomlm:mainfrom
JohnCampionJr:feat/mstest-mtp
Closed

JohnCampionJr wants to merge 1 commit into
tomlm:mainfrom
JohnCampionJr:feat/mstest-mtp

Conversation

@JohnCampionJr

Copy link
Copy Markdown
Collaborator

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.json pins the dotnet test runner).

Conversion map for review:

  • [Fact]/[Theory]/[InlineData]/[MemberData] → [TestMethod]/[DataRow]/[DynamicData]; TheoryData<> sources → IEnumerable<object[]>. DataRow is strict where xUnit coerced, so byte parameters carry casts in their rows.
  • xUnit Assert.* → Should() forms — scalars Be, collections Equal (not interchangeable; the compiler plus a full run arbitrated every site). Assert.Throws<T> → MSTest Assert.ThrowsExactly<T> (same exact-type semantics, same returned exception).
  • xUnit's Record.Exception has 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

…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
JohnCampionJr marked this pull request as draft August 30, 2026 23:19
@JohnCampionJr

Copy link
Copy Markdown
Collaborator Author

Tabling this for now

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