Chained ordered assertions
See original GitHub issueE.g.
A.SequenceOfCalls(
A.CallTo(() => fake.Bar(2)).MustHaveHappened(),
A.CallTo(() => fake.Bar(1)).MustHaveHappened());
…with, perhaps, a better method name.
@blairconrad has proved that this can work simply by adding syntactic sugar to the A
class.
update
The new syntax will be:
A.CallTo(() => fake.Bar(3)).MustHaveHappened(Repeated.Exactly.Twice)
.Then(A.CallTo(() => fake.Bar(2)).MustHaveHappened())
.Then(A.CallTo(() => fake.Bar(1)).MustHaveHappened());
- Remove #602 from the 2.0.0 milestone and label
wontfix
Issue Analytics
- State:
- Created 7 years ago
- Comments:77 (71 by maintainers)
Top Results From Across the Web
Ordered assertions
Using FakeItEasy you can assert that calls happened in a specific order on one or more fake objects. Details. One area where ordered...
Read more >Chained assertions - A crust of code
The assertions that are about the same data structure are clearly grouped together. · The two important functions are clearly visible at the...
Read more >c# - Chained Assertions
I use Code Contracts to take care of my assertions. Contract.Requires(customer.Age > 0); Contract.Requires(!string.
Read more >Chained AssertJ assertions should be simplified to the ...
This rule reports an issue when an assertion can be simplified to a dedicated one. The array below gives a non-exhaustive list of...
Read more >Weird evaluation order in chained functions - c++
My question : is it a compiler bug, or the evaluation order between chained calls is not guaranteed in this case ? Is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think idiomatic English would be:
so I’m wondering if this would this be possible:
A.OrderedSequence ?