jonsequitur / Its.Cqrs

A set of libraries for CQRS and Event Sourcing, with a Domain-Driven Design flavor.
Other
76 stars 21 forks source link

Replace test setups with action attributes #161

Closed jonsequitur closed 8 years ago

jonsequitur commented 8 years ago

I've refactored many of the tests to have less verbose, more composable setups using the NUnit action attributes feature.

wli3 commented 8 years ago

Much less code to write and tests are easier to read. I have a problem tho, when should I create a new attribute instead of write the test set up in the Setup()?

jonsequitur commented 8 years ago

If the setup is reusable across sets of tests and orthogonal to other setups, it seems like a good candidate for an attribute. The setups that are left are largely very specific to their test classes.