Benchmarks
These benchmarks compare aweXpect's happy-path overhead — passing assertions, the dominant case in a healthy test suite — against the equivalent FluentAssertions calls.
Methodology
- Suite:
HappyCaseBenchmarksdriven by BenchmarkDotNet. - Job:
MediumRunwith the in-process toolchain. - Runner:
ubuntu-latestGitHub Actions agent, refreshed on every push tomain. - Each tab shows the latest measured time and allocated memory; bars are scaled within the row so length corresponds to magnitude. Lower is better.
- String
- Boolean
- Integer
- Equivalency
- Items count
- String array
Verifies that two string values are equal, ignoring case.
aweXpect
await Expect.That(_stringSubject).IsEqualTo(_stringExpectation).IgnoringCase();
FluentAssertions
_stringSubject.Should().BeEquivalentTo(_stringExpectation, o => o.IgnoringCase());
Verifies that a boolean subject is true.
aweXpect
await Expect.That(_boolSubject).IsTrue();
FluentAssertions
_boolSubject.Should().BeTrue();
Verifies that an int subject is greater than a minimum.
aweXpect
await Expect.That(_intSubject).IsGreaterThan(_intMinimum);
FluentAssertions
_intSubject.Should().BeGreaterThan(_intMinimum);
Verifies that two deeply nested object trees are structurally equivalent.
aweXpect
await Expect.That(_nestedSubject).IsEquivalentTo(_nestedExpectation);
FluentAssertions
_nestedSubject.Should().BeEquivalentTo(_nestedExpectation);
Verifies that an IEnumerable<int> has at least the expected number of items (1,000 items in this benchmark).
aweXpect
await Expect.That(_enumerableSubject).HasCount().AtLeast(_enumerableCount);
FluentAssertions
_enumerableSubject.Should().HaveCountGreaterThanOrEqualTo(_enumerableCount);
Verifies that two three-element string arrays are equal in the same order.
In any order
Verifies that two three-element string arrays contain the same values regardless of order.
aweXpect
await Expect.That(_stringArraySubject).IsEqualTo(_stringArrayExpectation);
// In any order
await Expect.That(_stringArrayAnyOrderSubject)
.IsEqualTo(_stringArrayAnyOrderExpectation).InAnyOrder();
FluentAssertions
_stringArraySubject.Should().Equal(_stringArrayExpectation);
// In any order
_stringArrayAnyOrderSubject.Should().BeEquivalentTo(_stringArrayAnyOrderExpectation);