- Use
Install-Package mk.ControllerTests
to quickly build subcutaneous style tests for MVC/webapi controllers or any arbitrary "top of stack" interface. - Use
MvcControllerTestBase
to test a single action on aSystem.Web.Mvc.Controller
. The idea is that you will set up real state in a store/database and make assertions against it, thus testing from the top[ish] of the stack all the way into a real store. - Use
ApiControllerTestBase
to test behaviour on anApiController
. We use the WebApi 2 message pipeline and send a realHttpRequestMessage
. This way we can even test filters and other MVC internals. - If you have a service/abstraction that say, you use as an entry point for a background task, use that interface with the
AnyControllerTestBase
to test it's methods, and the behaviour all the way into the store. - Used successfully with real/lcoaldb MSSQL, embedded RavenDB, in-memory Event Store.
TODO: confidence, ROI, etc