TestBase-Mvc
2.0.3.1
See the version list below for details.
dotnet add package TestBase-Mvc --version 2.0.3.1
NuGet\Install-Package TestBase-Mvc -Version 2.0.3.1
<PackageReference Include="TestBase-Mvc" Version="2.0.3.1" />
paket add TestBase-Mvc --version 2.0.3.1
#r "nuget: TestBase-Mvc, 2.0.3.1"
// Install TestBase-Mvc as a Cake Addin #addin nuget:?package=TestBase-Mvc&version=2.0.3.1 // Install TestBase-Mvc as a Cake Tool #tool nuget:?package=TestBase-Mvc&version=2.0.3.1
*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)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- Microsoft.AspNet.Mvc (>= 4.0.20710)
- Microsoft.AspNet.WebApi (>= 4.0.20710)
- Microsoft.AspNet.WebApi.Core (>= 4.0.20710)
- NUnit (>= 2.6.2)
- TestBase (>= 2.0.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.1.4.3 | 3,890 | 11/20/2018 |
4.0.0 | 1,543 | 11/16/2018 |
3.1.0 | 2,037 | 7/24/2016 |
3.0.8.5 | 1,793 | 7/23/2016 |
3.0.8.3 | 1,802 | 4/14/2016 |
3.0.8.2 | 1,806 | 3/31/2016 |
3.0.8.1 | 1,769 | 3/30/2016 |
3.0.8 | 1,805 | 3/29/2016 |
3.0.7.6 | 1,750 | 3/14/2016 |
3.0.7.5 | 1,770 | 3/10/2016 |
3.0.7.4 | 1,888 | 2/11/2016 |
3.0.7.3 | 1,763 | 1/29/2016 |
3.0.7.2 | 1,774 | 1/28/2016 |
3.0.7.1 | 1,778 | 1/27/2016 |
3.0.7 | 1,800 | 1/27/2016 |
3.0.6.2 | 1,726 | 1/27/2016 |
3.0.6.1 | 1,782 | 1/26/2016 |
3.0.5 | 2,103 | 1/15/2016 |
3.0.4 | 1,897 | 1/13/2016 |
3.0.3 | 1,817 | 12/28/2015 |
3.0.2 | 4,049 | 12/27/2013 |
3.0.1.1 | 1,876 | 12/23/2013 |
3.0.1 | 2,020 | 11/28/2013 |
2.0.5 | 2,017 | 11/28/2013 |
2.0.4.1 | 1,888 | 11/12/2013 |
2.0.4 | 1,931 | 11/12/2013 |
2.0.3.1 | 1,903 | 11/8/2013 |
2.0.3 | 2,002 | 11/7/2013 |
2.0.2 | 1,977 | 11/7/2013 |
2.0.1 | 1,926 | 11/1/2013 |
1.0.4 | 1,920 | 10/31/2013 |
1.0.3 | 1,933 | 10/23/2013 |
Version 1. Unpolished but in use for over a year