Skip to content

cottsak/ControllerTests

Repository files navigation

ControllerTests Build status

tl;dr

  • 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 a System.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 an ApiController. We use the WebApi 2 message pipeline and send a real HttpRequestMessage. 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.

Why?

TODO: confidence, ROI, etc

Examples

MVC controller

WebApi controller

About

A package to simplify end-to-end testing for MVC and WebApi controllers while supporting legacy db schemas.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages