You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -167,49 +167,6 @@ It is **strongly advised** to read the [tutorial](http://docs.mytestedasp.net/tu
167
167
168
168
You can also check out the [provided samples](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/version-2.2/samples) for real-life ASP.NET Core MVC application testing.
169
169
170
-
## Package Installation
171
-
172
-
You can install this library using [NuGet](https://www.nuget.org/packages/MyTested.AspNetCore.Mvc.Universe) into your test project (or reference it directly in your `.csproj` file). Currently **MyTested.AspNetCore.Mvc** is fully compatible with ASP.NET Core MVC 2.2.0 and all older versions available on the official NuGet feed.
173
-
174
-
```powershell
175
-
Install-Package MyTested.AspNetCore.Mvc.Universe
176
-
```
177
-
178
-
This package will include all available assertion methods in your test project, including ones for authentication, database, session, caching and more. If you want only the MVC related features, install `MyTested.AspNetCore.Mvc`. If you want to use the completely **FREE** and **UNLIMITED** version of the library, install only `MyTested.AspNetCore.Mvc.Lite` and no other package. Additionally, if you prefer, you can be more specific by including only some of the packages:
179
-
180
-
-`MyTested.AspNetCore.Mvc.Configuration` - Contains setup and assertion methods for configurations
181
-
-`MyTested.AspNetCore.Mvc.Controllers` - Contains setup and assertion methods for controllers
182
-
-`MyTested.AspNetCore.Mvc.Controllers.Attributes` - Contains setup and assertion methods for controller attributes
183
-
-`MyTested.AspNetCore.Mvc.Controllers.ActionResults` - Contains setup and assertion methods for controller API action results
184
-
-`MyTested.AspNetCore.Mvc.Controllers.Views` - Contains setup and assertion methods for controller view features
185
-
-`MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults` - Contains setup and assertion methods for controller view action results
186
-
-`MyTested.AspNetCore.Mvc.Models` - Contains setup and assertion methods for response and view models
187
-
-`MyTested.AspNetCore.Mvc.Routing` - Contains setup and assertion methods for routes
188
-
-`MyTested.AspNetCore.Mvc.Core` - Contains setup and assertion methods for MVC core features
189
-
-`MyTested.AspNetCore.Mvc.TempData` - Contains setup and assertion methods for `ITempDataDictionary`
190
-
-`MyTested.AspNetCore.Mvc.ViewData` - Contains assertion methods for `ViewDataDictionary` and dynamic `ViewBag`
191
-
-`MyTested.AspNetCore.Mvc.ViewComponents` - Contains setup and assertion methods for view components
192
-
-`MyTested.AspNetCore.Mvc.ViewComponents.Attributes` - Contains setup and assertion methods for view component attributes
193
-
-`MyTested.AspNetCore.Mvc.ViewComponents.Results` - Contains setup and assertion methods for view component results
194
-
-`MyTested.AspNetCore.Mvc.ViewFeatures` - Contains setup and assertion methods for MVC view features
195
-
-`MyTested.AspNetCore.Mvc.Http` - Contains setup and assertion methods for HTTP context, request and response
196
-
-`MyTested.AspNetCore.Mvc.Authentication` - Contains setup methods for `ClaimsPrincipal`
197
-
-`MyTested.AspNetCore.Mvc.ModelState` - Contains setup and assertion methods for `ModelStateDictionary` validations
198
-
-`MyTested.AspNetCore.Mvc.DataAnnotations` - Contains setup and assertion methods for data annotation validations
199
-
-`MyTested.AspNetCore.Mvc.EntityFrameworkCore` - Contains setup and assertion methods for `DbContext`
200
-
-`MyTested.AspNetCore.Mvc.DependencyInjection` - Contains setup methods for dependency injection services
201
-
-`MyTested.AspNetCore.Mvc.Caching` - Contains setup and assertion methods for `IMemoryCache`
202
-
-`MyTested.AspNetCore.Mvc.Session` - Contains setup and assertion methods for `ISession`
203
-
-`MyTested.AspNetCore.Mvc.Options` - Contains setup and assertion methods for `IOptions`
204
-
-`MyTested.AspNetCore.Mvc.Helpers` - Contains additional helper methods for easier assertions
205
-
-`MyTested.AspNetCore.Mvc.Lite` - Completely **FREE** and **UNLIMITED** version of the library. It should not be used in combination with any other package. Includes `Controllers`, `Controllers.Views` and `ViewComponents`.
206
-
207
-
After the downloading is complete, just add `using MyTested.AspNetCore.Mvc;` to your source code and you are ready to test in the most elegant and developer friendly way.
208
-
209
-
```c#
210
-
usingMyTested.AspNetCore.Mvc;
211
-
```
212
-
213
170
## Test Examples
214
171
215
172
Here are some examples of how **powerful** the fluent testing API actually is!
@@ -227,9 +184,9 @@ A controller integration test uses the globally registered services from the `Te
227
184
// and tests for added by the action view bag entry,
228
185
// and tests for view result and model with specific assertions.
From.Services<IYetAnotherService>()) // Provides a global service.
448
+
.Instance(instance=>instance
449
+
.WithDependencies(
450
+
serviceMock,
451
+
anotherServiceMock,
452
+
From.Services<IYetAnotherService>())) // Provides a global service.
449
453
.InvokedWith(c=>c.InvokeAsync(1))
450
454
.ShouldReturn()
451
455
.View();
@@ -561,6 +565,49 @@ MyMvc
561
565
.Ok();
562
566
```
563
567
568
+
## Package Installation
569
+
570
+
You can install this library using [NuGet](https://www.nuget.org/packages/MyTested.AspNetCore.Mvc.Universe) into your test project (or reference it directly in your `.csproj` file). Currently **MyTested.AspNetCore.Mvc** is fully compatible with ASP.NET Core MVC 2.2.0 and all older versions available on the official NuGet feed.
571
+
572
+
```powershell
573
+
Install-Package MyTested.AspNetCore.Mvc.Universe
574
+
```
575
+
576
+
This package will include all available assertion methods in your test project, including ones for authentication, database, session, caching and more. If you want only the MVC related features, install `MyTested.AspNetCore.Mvc`. If you want to use the completely **FREE** and **UNLIMITED** version of the library, install only `MyTested.AspNetCore.Mvc.Lite` and no other package. Additionally, if you prefer, you can be more specific by including only some of the packages:
577
+
578
+
-`MyTested.AspNetCore.Mvc.Configuration` - Contains setup and assertion methods for configurations
579
+
-`MyTested.AspNetCore.Mvc.Controllers` - Contains setup and assertion methods for controllers
580
+
-`MyTested.AspNetCore.Mvc.Controllers.Attributes` - Contains setup and assertion methods for controller attributes
581
+
-`MyTested.AspNetCore.Mvc.Controllers.ActionResults` - Contains setup and assertion methods for controller API action results
582
+
-`MyTested.AspNetCore.Mvc.Controllers.Views` - Contains setup and assertion methods for controller view features
583
+
-`MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults` - Contains setup and assertion methods for controller view action results
584
+
-`MyTested.AspNetCore.Mvc.Models` - Contains setup and assertion methods for response and view models
585
+
-`MyTested.AspNetCore.Mvc.Routing` - Contains setup and assertion methods for routes
586
+
-`MyTested.AspNetCore.Mvc.Core` - Contains setup and assertion methods for MVC core features
587
+
-`MyTested.AspNetCore.Mvc.TempData` - Contains setup and assertion methods for `ITempDataDictionary`
588
+
-`MyTested.AspNetCore.Mvc.ViewData` - Contains assertion methods for `ViewDataDictionary` and dynamic `ViewBag`
589
+
-`MyTested.AspNetCore.Mvc.ViewComponents` - Contains setup and assertion methods for view components
590
+
-`MyTested.AspNetCore.Mvc.ViewComponents.Attributes` - Contains setup and assertion methods for view component attributes
591
+
-`MyTested.AspNetCore.Mvc.ViewComponents.Results` - Contains setup and assertion methods for view component results
592
+
-`MyTested.AspNetCore.Mvc.ViewFeatures` - Contains setup and assertion methods for MVC view features
593
+
-`MyTested.AspNetCore.Mvc.Http` - Contains setup and assertion methods for HTTP context, request and response
594
+
-`MyTested.AspNetCore.Mvc.Authentication` - Contains setup methods for `ClaimsPrincipal`
595
+
-`MyTested.AspNetCore.Mvc.ModelState` - Contains setup and assertion methods for `ModelStateDictionary` validations
596
+
-`MyTested.AspNetCore.Mvc.DataAnnotations` - Contains setup and assertion methods for data annotation validations
597
+
-`MyTested.AspNetCore.Mvc.EntityFrameworkCore` - Contains setup and assertion methods for `DbContext`
598
+
-`MyTested.AspNetCore.Mvc.DependencyInjection` - Contains setup methods for dependency injection services
599
+
-`MyTested.AspNetCore.Mvc.Caching` - Contains setup and assertion methods for `IMemoryCache`
600
+
-`MyTested.AspNetCore.Mvc.Session` - Contains setup and assertion methods for `ISession`
601
+
-`MyTested.AspNetCore.Mvc.Options` - Contains setup and assertion methods for `IOptions`
602
+
-`MyTested.AspNetCore.Mvc.Helpers` - Contains additional helper methods for easier assertions
603
+
-`MyTested.AspNetCore.Mvc.Lite` - Completely **FREE** and **UNLIMITED** version of the library. It should not be used in combination with any other package. Includes `Controllers`, `Controllers.Views` and `ViewComponents`.
604
+
605
+
After the downloading is complete, just add `using MyTested.AspNetCore.Mvc;` to your source code and you are ready to test in the most elegant and developer friendly way.
606
+
607
+
```c#
608
+
usingMyTested.AspNetCore.Mvc;
609
+
```
610
+
564
611
## Versioning
565
612
566
613
**MyTested.AspNetCore.Mvc** follows the ASP.NET Core MVC versions with which the testing framework is fully compatible. Specifically, the *major* and the *minor* versions will be incremented only when the MVC framework has a new official release. For example, version 2.2.\* of the testing framework is fully compatible with ASP.NET Core MVC 2.2.\*, version 1.1.\* is fully compatible with ASP.NET Core MVC 1.1.\*, version 1.0.15 is fully compatible with ASP.NET Core MVC 1.0.\*, and so on.
0 commit comments