Skip to content

Commit b1d94e3

Browse files
authored
Merge pull request #324 - Version 2.2.0
Version 2.2.0
2 parents cc32a6c + faa767d commit b1d94e3

File tree

161 files changed

+1838
-880
lines changed

Some content is hidden

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

161 files changed

+1838
-880
lines changed

.appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ branches:
44
- master
55
- development
66
- ^version-.*$
7-
image: Visual Studio 2019 Preview
7+
image: Visual Studio 2019
88
configuration: Release
99
clone_depth: 1
1010
before_build:

.travis.yml

+36-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,45 @@
11
language: csharp
2+
mono: none
3+
git:
4+
depth: 10
5+
group: travis_latest
26
sudo: required
3-
dist: trusty
4-
dotnet: 2.1.700
7+
dotnet: 2.2
58
solution: MyTested.AspNetCore.Mvc.sln
6-
mono: none
7-
os:
8-
- linux
9-
- osx
10-
osx_image: xcode9.4
9+
env:
10+
global:
11+
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
12+
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
13+
- NET_CORE_VERSION: netcoreapp2.2
14+
matrix:
15+
fast_finish: true
16+
include:
17+
- os: linux
18+
dist: xenial
19+
- os: osx
20+
dotnet: 2.2.300
21+
osx_image: xcode10.2
1122
branches:
1223
only:
1324
- master
1425
- development
1526
- ^version-.*$
1627
script:
17-
- dotnet test "samples/MusicStore/MusicStore.Test/MusicStore.Test.csproj" --configuration Release --framework netcoreapp2.1
18-
- dotnet test "samples/Blog/Blog.Test/Blog.Test.csproj" --configuration Release --framework netcoreapp2.1
19-
- dotnet test "samples/ApplicationParts/ApplicationParts.Test/ApplicationParts.Test.csproj" --configuration Release --framework netcoreapp2.1
20-
- dotnet test "samples/Autofac/Autofac.AssemblyInit.Test/Autofac.AssemblyInit.Test.csproj" --configuration Release --framework netcoreapp2.1
21-
- dotnet test "samples/Autofac/Autofac.NoContainerBuilder.Test/Autofac.NoContainerBuilder.Test.csproj" --configuration Release --framework netcoreapp2.1
22-
- dotnet test "samples/Autofac/Autofac.Test/Autofac.Test.csproj" --configuration Release --framework netcoreapp2.1
23-
- dotnet test "samples/Configuration/Test.Core.MissingAppPackage/Test.Core.MissingAppPackage.csproj" --configuration Release --framework netcoreapp2.1
24-
- dotnet test "samples/Configuration/Test.DifferentEnvironment/Test.DifferentEnvironment.csproj" --configuration Release --framework netcoreapp2.1
25-
- dotnet test "samples/Configuration/Test.ExplicitNoStartupType/Test.ExplicitNoStartupType.csproj" --configuration Release --framework netcoreapp2.1
26-
- dotnet test "samples/Configuration/Test.MissingStartupType/Test.MissingStartupType.csproj" --configuration Release --framework netcoreapp2.1
27-
- dotnet test "samples/Configuration/Test.NoAsync/Test.NoAsync.csproj" --configuration Release --framework netcoreapp2.1
28-
- dotnet test "samples/Configuration/Test.NoStartupType/Test.NoStartupType.csproj" --configuration Release --framework netcoreapp2.1
29-
- dotnet test "samples/Configuration/Test.WrongStartupType/Test.WrongStartupType.csproj" --configuration Release --framework netcoreapp2.1
30-
- dotnet test "samples/Configuration/Test.WrongTestAssembly/Test.WrongTestAssembly.csproj" --configuration Release --framework netcoreapp2.1
31-
- dotnet test "samples/Configuration/Test.WrongWebAssembly/Test.WrongWebAssembly.csproj" --configuration Release --framework netcoreapp2.1
32-
- dotnet test "samples/Lite/Lite.Test/Lite.Test.csproj" --configuration Release --framework netcoreapp2.1
33-
- dotnet test "samples/NoStartup/NoStartup.Test/NoStartup.Test.csproj" --configuration Release --framework netcoreapp2.1
34-
- dotnet test "samples/WebStartup/WebStartup.Test/WebStartup.Test.csproj" --configuration Release --framework netcoreapp2.1
28+
- dotnet test "samples/MusicStore/MusicStore.Test/MusicStore.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
29+
- dotnet test "samples/Blog/Blog.Test/Blog.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
30+
- dotnet test "samples/ApplicationParts/ApplicationParts.Test/ApplicationParts.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
31+
- dotnet test "samples/Autofac/Autofac.AssemblyInit.Test/Autofac.AssemblyInit.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
32+
- dotnet test "samples/Autofac/Autofac.NoContainerBuilder.Test/Autofac.NoContainerBuilder.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
33+
- dotnet test "samples/Autofac/Autofac.Test/Autofac.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
34+
- dotnet test "samples/Configuration/Test.Core.MissingAppPackage/Test.Core.MissingAppPackage.csproj" --configuration Release --framework "$NET_CORE_VERSION"
35+
- dotnet test "samples/Configuration/Test.DifferentEnvironment/Test.DifferentEnvironment.csproj" --configuration Release --framework "$NET_CORE_VERSION"
36+
- dotnet test "samples/Configuration/Test.ExplicitNoStartupType/Test.ExplicitNoStartupType.csproj" --configuration Release --framework "$NET_CORE_VERSION"
37+
- dotnet test "samples/Configuration/Test.MissingStartupType/Test.MissingStartupType.csproj" --configuration Release --framework "$NET_CORE_VERSION"
38+
- dotnet test "samples/Configuration/Test.NoAsync/Test.NoAsync.csproj" --configuration Release --framework "$NET_CORE_VERSION"
39+
- dotnet test "samples/Configuration/Test.NoStartupType/Test.NoStartupType.csproj" --configuration Release --framework "$NET_CORE_VERSION"
40+
- dotnet test "samples/Configuration/Test.WrongStartupType/Test.WrongStartupType.csproj" --configuration Release --framework "$NET_CORE_VERSION"
41+
- dotnet test "samples/Configuration/Test.WrongTestAssembly/Test.WrongTestAssembly.csproj" --configuration Release --framework "$NET_CORE_VERSION"
42+
- dotnet test "samples/Configuration/Test.WrongWebAssembly/Test.WrongWebAssembly.csproj" --configuration Release --framework "$NET_CORE_VERSION"
43+
- dotnet test "samples/Lite/Lite.Test/Lite.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
44+
- dotnet test "samples/NoStartup/NoStartup.Test/NoStartup.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"
45+
- dotnet test "samples/WebStartup/WebStartup.Test/WebStartup.Test.csproj" --configuration Release --framework "$NET_CORE_VERSION"

MyTested.AspNetCore.Mvc.sln

+7
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyTested.AspNetCore.Mvc.Con
231231
EndProject
232232
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyTested.AspNetCore.Mvc.ViewComponents.Results.Test", "test\MyTested.AspNetCore.Mvc.ViewComponents.Results.Test\MyTested.AspNetCore.Mvc.ViewComponents.Results.Test.csproj", "{32B24AD2-9D35-4A5A-86CE-8C7862DED27E}"
233233
EndProject
234+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.Core.MissingWebSdk", "samples\Configuration\Test.Core.MissingWebSdk\Test.Core.MissingWebSdk.csproj", "{E88A7195-A252-4C51-8255-6442ADD67874}"
235+
EndProject
234236
Global
235237
GlobalSection(SolutionConfigurationPlatforms) = preSolution
236238
Debug|Any CPU = Debug|Any CPU
@@ -645,6 +647,10 @@ Global
645647
{32B24AD2-9D35-4A5A-86CE-8C7862DED27E}.Debug|Any CPU.Build.0 = Debug|Any CPU
646648
{32B24AD2-9D35-4A5A-86CE-8C7862DED27E}.Release|Any CPU.ActiveCfg = Release|Any CPU
647649
{32B24AD2-9D35-4A5A-86CE-8C7862DED27E}.Release|Any CPU.Build.0 = Release|Any CPU
650+
{E88A7195-A252-4C51-8255-6442ADD67874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
651+
{E88A7195-A252-4C51-8255-6442ADD67874}.Debug|Any CPU.Build.0 = Debug|Any CPU
652+
{E88A7195-A252-4C51-8255-6442ADD67874}.Release|Any CPU.ActiveCfg = Release|Any CPU
653+
{E88A7195-A252-4C51-8255-6442ADD67874}.Release|Any CPU.Build.0 = Release|Any CPU
648654
EndGlobalSection
649655
GlobalSection(SolutionProperties) = preSolution
650656
HideSolutionNode = FALSE
@@ -761,6 +767,7 @@ Global
761767
{03CFC257-39A4-4FFE-8FB5-AB43D055DFE8} = {D140FA14-A6C2-4279-8A41-35BC55279DA8}
762768
{4E038FA2-52FA-47CD-8797-6FD6CAE8741E} = {D140FA14-A6C2-4279-8A41-35BC55279DA8}
763769
{32B24AD2-9D35-4A5A-86CE-8C7862DED27E} = {D140FA14-A6C2-4279-8A41-35BC55279DA8}
770+
{E88A7195-A252-4C51-8255-6442ADD67874} = {7BEC9808-8650-4322-BCC6-1D7D91B53678}
764771
EndGlobalSection
765772
GlobalSection(ExtensibilityGlobals) = postSolution
766773
SolutionGuid = {99A2DEDD-5195-4EE6-A546-B1CA54C5539F}

README.md

+13-15
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
*Downloads:* [![NuGet Badge](https://buildstats.info/nuget/MyTested.AspNetCore.Mvc)](https://www.nuget.org/packages/MyTested.AspNetCore.Mvc/)
2626

27-
<img src="https://raw.githubusercontent.com/ivaylokenov/MyTested.AspNetCore.Mvc/version-2.1/tools/test-sample.gif" />
27+
<img src="https://raw.githubusercontent.com/ivaylokenov/MyTested.AspNetCore.Mvc/version-2.2/tools/test-sample.gif" />
2828

29-
**MyTested.AspNetCore.Mvc** has [more than 500 assertion methods](https://MyTestedASP.NET/Core/Mvc/Features) and is 100% covered by [more than 2000 unit tests](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/version-2.1/test). It should work correctly. Almost all items in the [issues page](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/issues) are expected future features and enhancements.
29+
**MyTested.AspNetCore.Mvc** has [more than 500 assertion methods](https://MyTestedASP.NET/Core/Mvc/Features) and is 100% covered by [more than 2000 unit tests](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/version-2.2/test). It should work correctly. Almost all items in the [issues page](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/issues) are expected future features and enhancements.
3030

3131
**MyTested.AspNetCore.Mvc** helps you speed up the testing process in your web development team! If you find that statement unbelievable, these are the words which some of the many happy **MyTested.AspNetCore.Mvc** users once said:
3232
> "I’ve been using your packages for almost 3 years now and it has saved me countless hours in creating unit tests and wanted to thank you for making this. I cannot imagine how much code I would have had to write to create the 450+ and counting unit tests I have for my controllers."
@@ -95,15 +95,15 @@ To add **MyTested.AspNetCore.Mvc** to your solution, you must follow these simpl
9595
<Project Sdk="Microsoft.NET.Sdk.Web"> <!-- Changed project SDK -->
9696

9797
<PropertyGroup>
98-
<TargetFramework>netcoreapp2.1</TargetFramework>
98+
<TargetFramework>netcoreapp2.2</TargetFramework>
9999
</PropertyGroup>
100100

101101
<ItemGroup>
102102
<PackageReference Include="Microsoft.AspNetCore.App" /> <!-- Reference to the web framework -->
103-
<PackageReference Include="MyTested.AspNetCore.Mvc.Universe" Version="2.1.0" />
104-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
105-
<PackageReference Include="xunit" Version="2.4.0" /> <!-- Can be any testing framework -->
106-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
103+
<PackageReference Include="MyTested.AspNetCore.Mvc.Universe" Version="2.2.0" />
104+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
105+
<PackageReference Include="xunit" Version="2.4.1" /> <!-- Can be any testing framework -->
106+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
107107
</ItemGroup>
108108

109109
<ItemGroup>
@@ -159,17 +159,17 @@ namespace MyApp.Tests.Controllers
159159
}
160160
```
161161

162-
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/version-2.1/samples) for other types of test runners and `Startup` class configurations.
162+
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/version-2.2/samples) for other types of test runners and `Startup` class configurations.
163163

164164
## Detailed Documentation
165165

166166
It is **strongly advised** to read the [tutorial](http://docs.mytestedasp.net/tutorial/intro.html) to get familiar with **MyTested.AspNetCore.Mvc** in more details. Additionally, you may see the [testing guide](http://docs.mytestedasp.net/guide/intro.html) or the [API reference](http://docs.mytestedasp.net/api/index.html) for a full list of available features.
167167

168-
You can also check out the [provided samples](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/version-2.1/samples) for real-life ASP.NET Core MVC application testing.
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.
169169

170170
## Package Installation
171171

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.1.0 and all older versions available on the official NuGet feed.
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.
173173

174174
```powershell
175175
Install-Package MyTested.AspNetCore.Mvc.Universe
@@ -214,7 +214,7 @@ using MyTested.AspNetCore.Mvc;
214214

215215
Here are some examples of how **powerful** the fluent testing API actually is!
216216

217-
**MyTested.AspNetCore.Mvc** is so **awesome** that each test can be written in **one single line** like in this [application sample](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/version-2.1/samples/Blog)!
217+
**MyTested.AspNetCore.Mvc** is so **awesome** that each test can be written in **one single line** like in this [application sample](https://github.com/ivaylokenov/MyTested.AspNetCore.Mvc/tree/version-2.2/samples/Blog)!
218218

219219
### Controller Integration Tests
220220

@@ -281,7 +281,6 @@ MyController<MyMvcController>
281281
// and tests for added by the action temp data entry with а specific key,
282282
// and tests for redirect result to a specific action.
283283
MyController<MyMvcController>
284-
.Instance()
285284
.Calling(c => c.MyAction(new MyFormModel
286285
{
287286
Title = title,
@@ -409,7 +408,6 @@ MyController<MyMvcController>
409408

410409
// Tests for specific action attributes - HttpGet, AllowAnonymous, ValidateAntiForgeryToken, and ActionName.
411410
MyController<MyMvcController>
412-
.Instance()
413411
.Calling(c => c.MyAction(With.Empty<int>())) // Provides no value for the action parameter.
414412
.ShouldHave()
415413
.ActionAttributes(attributes => attributes
@@ -566,7 +564,7 @@ MyMvc
566564

567565
## Versioning
568566

569-
**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.1.\* of the testing framework is fully compatible with ASP.NET Core MVC 2.1.\*, 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.
567+
**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.
570568

571569
The public interface of **MyTested.AspNetCore.Mvc** will not have any breaking changes when the version increases (unless entirely necessary).
572570

@@ -580,7 +578,7 @@ The source code of **MyTested.AspNetCore.Mvc** and its extensions (the full vers
580578

581579
Without a license code, the full version of the library allows up to 100 assertions (around 25 test cases) per test project. **MyTested.AspNetCore.Mvc versions before 3.0.0 do not have such restrictions and work without any limitations.**
582580

583-
**Full-featured license codes can be requested for free by individuals, open-source projects, startups, and educational institutions**. See [https://MyTestedASP.NET/Core/Mvc#free-usage](https://MyTestedASP.NET/Core/Mvc#free-usage) for more information.
581+
**Full-featured license codes can be requested for free by small businesses (up to 5 developers), individuals, open-source projects, startups, and educational institutions**. See [https://MyTestedASP.NET/Core/Mvc#free-usage](https://MyTestedASP.NET/Core/Mvc#free-usage) for more information.
584582

585583
Commercial licensing with premium support options is also available at [https://MyTestedASP.NET/Core/Mvc#pricing](https://MyTestedASP.NET/Core/Mvc#pricing).
586584

samples/ApplicationParts/ApplicationParts.Controllers/ApplicationParts.Controllers.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.*" />
20-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.1.*" />
19+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.*" />
20+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.*" />
2121
</ItemGroup>
2222

2323
</Project>

samples/ApplicationParts/ApplicationParts.Models/ApplicationParts.Models.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.1.*" />
15-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.*" />
14+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.*" />
15+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.*" />
1616
</ItemGroup>
1717

1818
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.1</TargetFramework>
4+
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
5+
<PreserveCompilationContext>true</PreserveCompilationContext>
56
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
67
</PropertyGroup>
78

@@ -15,10 +16,9 @@
1516
</ItemGroup>
1617

1718
<ItemGroup>
18-
<PackageReference Include="Microsoft.AspNetCore.App" />
19-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
20-
<PackageReference Include="NUnit" Version="3.11.0" />
21-
<PackageReference Include="NUnit3TestAdapter" Version="3.11.2" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
20+
<PackageReference Include="NUnit" Version="3.12.0" />
21+
<PackageReference Include="NUnit3TestAdapter" Version="3.14.0" />
2222
</ItemGroup>
2323

2424
</Project>

samples/ApplicationParts/ApplicationParts.Test/Properties/launchSettings.json

-27
This file was deleted.

0 commit comments

Comments
 (0)