Skip to content

Commit e4f3a29

Browse files
authored
Merge pull request #225 from ivaylokenov/dependency-context-issues
Dependency context issues
2 parents ebd46b4 + 2e291ef commit e4f3a29

File tree

194 files changed

+39290
-1346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+39290
-1346
lines changed

MyTested.AspNetCore.Mvc.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MyTested.AspNetCore.Mvc.Mod
122122
EndProject
123123
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MyTested.AspNetCore.Mvc.ModelState.Test", "test\MyTested.AspNetCore.Mvc.ModelState.Test\MyTested.AspNetCore.Mvc.ModelState.Test.xproj", "{85915D02-3635-4BF3-9795-9FAD378AFE94}"
124124
EndProject
125+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NoStartup", "NoStartup", "{45B7B5FC-DF8C-498E-956E-28D56946C7DA}"
126+
EndProject
127+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NoStartup.Controllers", "samples\NoStartup\NoStartup.Controllers\NoStartup.Controllers.xproj", "{3FE2494F-887A-4C7D-9CE6-4C53489A966D}"
128+
EndProject
129+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NoStartup.Services", "samples\NoStartup\NoStartup.Services\NoStartup.Services.xproj", "{7F5BA229-DC61-416A-B03A-0DE756C2459F}"
130+
EndProject
131+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NoStartup.Components", "samples\NoStartup\NoStartup.Components\NoStartup.Components.xproj", "{A8975050-1824-46FB-A3EF-1C1B5CC5EF88}"
132+
EndProject
133+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NoStartup.Test", "samples\NoStartup\NoStartup.Test\NoStartup.Test.xproj", "{D28E4019-DC88-452D-8AEF-46799AB32B45}"
134+
EndProject
125135
Global
126136
GlobalSection(SolutionConfigurationPlatforms) = preSolution
127137
Debug|Any CPU = Debug|Any CPU
@@ -336,6 +346,22 @@ Global
336346
{85915D02-3635-4BF3-9795-9FAD378AFE94}.Debug|Any CPU.Build.0 = Debug|Any CPU
337347
{85915D02-3635-4BF3-9795-9FAD378AFE94}.Release|Any CPU.ActiveCfg = Release|Any CPU
338348
{85915D02-3635-4BF3-9795-9FAD378AFE94}.Release|Any CPU.Build.0 = Release|Any CPU
349+
{3FE2494F-887A-4C7D-9CE6-4C53489A966D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
350+
{3FE2494F-887A-4C7D-9CE6-4C53489A966D}.Debug|Any CPU.Build.0 = Debug|Any CPU
351+
{3FE2494F-887A-4C7D-9CE6-4C53489A966D}.Release|Any CPU.ActiveCfg = Release|Any CPU
352+
{3FE2494F-887A-4C7D-9CE6-4C53489A966D}.Release|Any CPU.Build.0 = Release|Any CPU
353+
{7F5BA229-DC61-416A-B03A-0DE756C2459F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
354+
{7F5BA229-DC61-416A-B03A-0DE756C2459F}.Debug|Any CPU.Build.0 = Debug|Any CPU
355+
{7F5BA229-DC61-416A-B03A-0DE756C2459F}.Release|Any CPU.ActiveCfg = Release|Any CPU
356+
{7F5BA229-DC61-416A-B03A-0DE756C2459F}.Release|Any CPU.Build.0 = Release|Any CPU
357+
{A8975050-1824-46FB-A3EF-1C1B5CC5EF88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
358+
{A8975050-1824-46FB-A3EF-1C1B5CC5EF88}.Debug|Any CPU.Build.0 = Debug|Any CPU
359+
{A8975050-1824-46FB-A3EF-1C1B5CC5EF88}.Release|Any CPU.ActiveCfg = Release|Any CPU
360+
{A8975050-1824-46FB-A3EF-1C1B5CC5EF88}.Release|Any CPU.Build.0 = Release|Any CPU
361+
{D28E4019-DC88-452D-8AEF-46799AB32B45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
362+
{D28E4019-DC88-452D-8AEF-46799AB32B45}.Debug|Any CPU.Build.0 = Debug|Any CPU
363+
{D28E4019-DC88-452D-8AEF-46799AB32B45}.Release|Any CPU.ActiveCfg = Release|Any CPU
364+
{D28E4019-DC88-452D-8AEF-46799AB32B45}.Release|Any CPU.Build.0 = Release|Any CPU
339365
EndGlobalSection
340366
GlobalSection(SolutionProperties) = preSolution
341367
HideSolutionNode = FALSE
@@ -395,5 +421,10 @@ Global
395421
{16FC9EF0-F27E-4814-9FAC-C2054314CE9E} = {D140FA14-A6C2-4279-8A41-35BC55279DA8}
396422
{13A781F9-8766-4016-B72E-FA7E61DCF85F} = {09353A03-2B0C-496B-8EB1-2CB6A22D758B}
397423
{85915D02-3635-4BF3-9795-9FAD378AFE94} = {D140FA14-A6C2-4279-8A41-35BC55279DA8}
424+
{45B7B5FC-DF8C-498E-956E-28D56946C7DA} = {88CC5098-E49F-4AA4-B964-1C2BF4ECA3C3}
425+
{3FE2494F-887A-4C7D-9CE6-4C53489A966D} = {45B7B5FC-DF8C-498E-956E-28D56946C7DA}
426+
{7F5BA229-DC61-416A-B03A-0DE756C2459F} = {45B7B5FC-DF8C-498E-956E-28D56946C7DA}
427+
{A8975050-1824-46FB-A3EF-1C1B5CC5EF88} = {45B7B5FC-DF8C-498E-956E-28D56946C7DA}
428+
{D28E4019-DC88-452D-8AEF-46799AB32B45} = {45B7B5FC-DF8C-498E-956E-28D56946C7DA}
398429
EndGlobalSection
399430
EndGlobal

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MyTested.AspNetCore.Mvc is a unit testing library (currently in preview version)
77

88
## Getting started
99

10-
It is strongly advised to start with the [tutorial](http://docs.mytestedasp.net/tutorial/intro.html) (coming soon) in order to get familiar with MyTested.AspNetCore.Mvc. Additionally, you may see the [testing guide](http://docs.mytestedasp.net/guide/intro.html) (coming soon) or the [API reference](http://docs.mytestedasp.net/api/index.html) for full list of available features. MyTested.AspNetCore.Mvc is 100% covered by [more than 1500 unit tests](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/master/test/) and should work correctly. Almost all items in the [issues page](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/issues) are expected future features and enhancements.
10+
It is strongly advised to start with the [tutorial](http://docs.mytestedasp.net/tutorial/intro.html) (coming soon) in order to get familiar with MyTested.AspNetCore.Mvc. Additionally, you may see the [testing guide](http://docs.mytestedasp.net/guide/intro.html) (coming soon) or the [API reference](http://docs.mytestedasp.net/api/index.html) for full list of available features. MyTested.AspNetCore.Mvc is 100% covered by [more than 1800 unit tests](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/master/test/) and should work correctly. Almost all items in the [issues page](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/issues) are expected future features and enhancements.
1111

1212
## Installation
1313

@@ -52,7 +52,7 @@ Make sure to check out the [tutorial](http://docs.mytestedasp.net/tutorial/intro
5252

5353
You can also check out the [provided samples](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/master/samples) for real-life ASP.NET Core MVC application testing.
5454

55-
First we need to create a `TestStartup` class in the root of the test project in order to register the dependency injection services. The easiest way is to inherit from the web project's `Startup` class and replace some of the services with mocked ones by using the provided extension methods.
55+
The easiest way to start with MyTested.AspNetCore.Mvc is to create a `TestStartup` class at the root of the test project in order to register the dependency injection services which will be used by all test cases in the assembly. A fast solution is to inherit from the web project's `Startup` class and replace some of the services with mocked ones by using the provided extension methods.
5656

5757
```c#
5858
namespace MyApp.Tests
@@ -98,8 +98,7 @@ namespace MyApp.Tests.Controllers
9898
}
9999
```
100100

101-
The example uses [xUnit](http://xunit.github.io/) but you can use whatever testing framework you want.
102-
Basically, MyTested.AspNetCore.Mvc throws an unhandled exception with a friendly error message if the assertion does not pass and the test fails.
101+
Basically, MyTested.AspNetCore.Mvc throws an unhandled exception with a friendly error message if the assertion does not pass and the test fails. The example uses [xUnit](http://xunit.github.io/) but you can use any other framework you like. See the [samples](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/master/samples) for other types of test runners and `Startup` class configurations.
103102

104103
## Examples
105104

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
2-
"version": "1.0.0",
3-
42
"dependencies": {
53
"NETStandard.Library": "1.6.0-*",
64
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
75
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
8-
"ApplicationParts.Models": "1.0.0-*",
9-
"ApplicationParts.Services": "1.0.0-*"
6+
"ApplicationParts.Models": "*",
7+
"ApplicationParts.Services": "*"
108
},
119

1210
"frameworks": {
13-
"netstandard1.6": {}
11+
"netstandard1.6": {},
12+
"net451": {}
1413
}
1514
}

0 commit comments

Comments
 (0)