Sign in Sign up
nuget

TestBase-Mvc

*TestBase* gets you off to a flying start when unit testing projects with dependencies. TestBase-Mvc adds a rich extensible set of fluent assertions for verifying Mvc ActionResults and for easy setup of ControllerContext and HttpContext for both Mvc and WebApi TestBase.Shoulds ------------------- Chainable fluent assertions get you to the point concisely ControllerUnderTest.Action() .ShouldbeViewResult() .ShouldHaveModel<TModel>() .ShouldEqualByValue(expected) ControllerUnderTest.Action() .ShouldBeRedirectToRouteResult() .ShouldHaveRouteValue("expectedKey", [Optional] "expectedValue"); ShouldHaveViewDataContaining(), ShouldBeJsonResult() etc. TestBase ---------- Controller extensions to fake the http request & context. By injecting the RegisterRoutes method of your MvcApplication, you can use and test Controller.Url with your application's configured routes. ControllerUnderTest .WithHttpContextAndRoutes( [Optional] Action<RouteCollection> mvcApplicationRoutesRegistration, [optional] string requestUrl, [Optional] string query = "", [Optional] string appVirtualPath = "/", [Optional] HttpApplication applicationInstance) ApiControllerUnderTest.WithWebApiHttpContext<T>( HttpMethod httpMethod, [Optional] string requestUri, [Optional] string routeTemplate)

Activity

Latest release
7y ago
Total releases
32
Cadence
~3 days
Last 12 months
0

Reach

Stars

Details

First release
Oct 23, 2013
Releases
Version Released
4.1.4.3 minor
4.0.0 major
3.1.0 minor
3.0.8.5 patch
3.0.8.3 patch
3.0.8.2 patch
3.0.8.1 patch
3.0.8 patch
3.0.7.6 patch
3.0.7.5 patch
3.0.7.4 patch
3.0.7.3 patch
3.0.7.2 patch
3.0.7.1 patch
3.0.7 patch
3.0.6.2 patch
3.0.6.1 patch
3.0.5 patch
3.0.4 patch
3.0.3 patch
3.0.2 patch
3.0.1.1 patch
3.0.1 major
2.0.5 patch
2.0.4.1 patch
2.0.4 patch
2.0.3.1 patch
2.0.3 patch
2.0.2 patch
2.0.1 major
1.0.4 patch
1.0.3 initial