Rank: Newbie
Groups: Registered
Joined: 5/22/2026(UTC) Posts: 1
|
Hi, I am passing some complex objects to an xunit test. I see in other posts that NCrunch will collapse these test and show a single result. The problem that i have though is that single result was showing a pass. When i used VS2022 test runner it correctly showed a fail for one of the tests. In my case it will return the result of the last test and hide any earlier failures - not ideal. The RDI shows that the method evaluation and the expected result were different values and shows the full set of calls made to the test method. Is there a way to resolve this? I tried the suggestion of using IXunitSerializable from one of the other posts but the tests took way too long to run and all showed a fail then. Code:
[Theory]
[ClassData(typeof(GetChosenSummerSelection))]
internal void MixedLeagueClass_ShouldBeBasedOnSummerLeagueSelectionAndNomination(
TestCase data)
{
var result = CallEvaluate(
data.MixedLeagueRank,
data.SummerSelectedDivisions,
data.SummerNominatedRank);
result.Should().Be(data.Expected);
}
...
internal class GetChosenSummerSelection : TheoryData<TestCase>
{
public GetChosenSummerSelection()
{
Add(new TestCase(10, "", DR.Class1, [CreateSelected(DR.Class2, 1)], null, true));
Add(new TestCase(20, "", DR.Class1, [CreateSelected(DR.Class3, 1)], null, true));
}
}
This shows the results [img]null[/img] test runnerThanks
|