Description
Considering the example from the Documentation regarding Collections with a slight change:
var numbers = new[] { 1, 2, 3, 4, 1 };
// Assert count and then chain with other collection assertions
await Assert.That(numbers)
.Count().IsEqualTo(5)
.And.Contains(3)
.And.IsInOrder();
Produces a unclear Assertion Failure:
[Assertion Failure] Expected both conditions and to be in ascending order but item at index 4 (1) was less than previous item (4)
issues:
- talks about "both" conditions, even though there are 3
- doesn't mention the passing conditions (but it does so, if
.And is chained only once)
Expected Behavior
[Assertion Failure] Expected 3 conditions
first condition
and second condition
and to be in ascending order
but item at index 4 (1) was less than previous item (4) violating condition 3
Actual Behavior
[Assertion Failure] Expected both conditions
and to be in ascending order
but item at index 4 (1) was less than previous item (4)
Steps to Reproduce
public async Task MultipleAndTest()
{
var numbers = new[] { 1, 2, 3, 4, 1 };
// Assert count and then chain with other collection assertions
await Assert.That(numbers)
.Count().IsEqualTo(5)
.And.Contains(3)
.And.IsInOrder();
}
TUnit Version
v1.34.5 (minor)
.NET Version
NET 10.0.103
Operating System
Linux
IDE / Test Runner
JetBrains Rider
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
Description
Considering the example from the Documentation regarding Collections with a slight change:
Produces a unclear Assertion Failure:
[Assertion Failure] Expected both conditions and to be in ascending order but item at index 4 (1) was less than previous item (4)issues:
.Andis chained only once)Expected Behavior
[Assertion Failure] Expected 3 conditions
first condition
and second condition
and to be in ascending order
but item at index 4 (1) was less than previous item (4) violating condition 3
Actual Behavior
[Assertion Failure] Expected both conditions
and to be in ascending order
but item at index 4 (1) was less than previous item (4)
Steps to Reproduce
TUnit Version
v1.34.5 (minor)
.NET Version
NET 10.0.103
Operating System
Linux
IDE / Test Runner
JetBrains Rider
Error Output / Stack Trace
Additional Context
No response
IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE