Migrating from Fluentassertions, is there a good way to rewrite property chaining?
I.e. something like this:
result
.Should()
.BeOfType<EventHandled>()
.Subject.ConsecutiveEvents[0]
.Should()
.Be(@event.Source);
I can replicate the first part easy enough
await Assert.That(result).IsTypeOf<EventHandled>
But how to access the ConsecutiveEvents?
I need to expand the chaining functionality for properties etc.
It doesn't exist right now, and would require another Assertion line where you manually pass the property into a new Assert.That() call.
The syntax that I'll probably build though would most likely look like:
Assert.That(obj)
.IsTypeOf<Something>()
.And
.Item(x => x.ConsecutiveEvents[0])
.IsEqualTo("Foo");
Thanks, that looks sensible
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.