0
kicks
Arrange Act Assert and BDD specifications
With Rhino Mocks 3.5 just around the corner, I've started using it to create much more readable tests. One of the things that always bothered me with Expect.Call, constraints and the like was that it mixed in the Arrange with Assert. For those that haven't heard of AAA, it's a pattern for authoring unit tests:
* Arrange - set up the unit under test
* Act - exercise the unit under test, capturing any resulting state
* Assert - verify the behavior through assertions
As I moved towards BDD context/specification style tests, working with Rhino Mocks didn't fit the picture very well. But with the new AAA syntax of Rhino Mocks 3.5, I can very cleanly separate out the behavior I want to observe from the mechanics of setting up the test.