Skip to content

Commit ecaa94a

Browse files
committed
Added services to reflect version 1.1.0 changes (closes #257, closes #258)
1 parent 8032952 commit ecaa94a

File tree

65 files changed

+1208
-24
lines changed

Some content is hidden

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

65 files changed

+1208
-24
lines changed

samples/ApplicationParts/ApplicationParts.Test/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"MyTested.AspNetCore.Mvc.Controllers": "1.1.0",
1515
"MyTested.AspNetCore.Mvc.ViewActionResults": "1.1.0",
1616
"MyTested.AspNetCore.Mvc.Routing": "1.1.0",
17+
"Microsoft.DotNet.InternalAbstractions": "1.0.0", // remove when not needed
1718
"Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
1819
"ApplicationParts.Web": "*",
1920
"ApplicationParts.Controllers": "*"

samples/ApplicationParts/ApplicationParts.Test/project.lock.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,25 @@
972972
}
973973
}
974974
},
975+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
976+
"type": "package",
977+
"dependencies": {
978+
"System.AppContext": "4.1.0",
979+
"System.Collections": "4.0.11",
980+
"System.IO": "4.1.0",
981+
"System.IO.FileSystem": "4.0.1",
982+
"System.Reflection.TypeExtensions": "4.1.0",
983+
"System.Runtime.Extensions": "4.1.0",
984+
"System.Runtime.InteropServices": "4.1.0",
985+
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
986+
},
987+
"compile": {
988+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
989+
},
990+
"runtime": {
991+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
992+
}
993+
},
975994
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
976995
"type": "package",
977996
"dependencies": {
@@ -5224,6 +5243,15 @@
52245243
}
52255244
}
52265245
},
5246+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
5247+
"type": "package",
5248+
"compile": {
5249+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll": {}
5250+
},
5251+
"runtime": {
5252+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll": {}
5253+
}
5254+
},
52275255
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
52285256
"type": "package",
52295257
"compile": {
@@ -7411,6 +7439,17 @@
74117439
"runtimes/win8-arm/native/Microsoft.DiaSymReader.Native.arm.dll"
74127440
]
74137441
},
7442+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
7443+
"sha512": "AAguUq7YyKk3yDWPoWA8DrLZvURxB/LrDdTn1h5lmPeznkFUpfC3p459w5mQYQE0qpquf/CkSQZ0etiV5vRHFA==",
7444+
"type": "package",
7445+
"path": "Microsoft.DotNet.InternalAbstractions/1.0.0",
7446+
"files": [
7447+
"Microsoft.DotNet.InternalAbstractions.1.0.0.nupkg.sha512",
7448+
"Microsoft.DotNet.InternalAbstractions.nuspec",
7449+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll",
7450+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll"
7451+
]
7452+
},
74147453
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
74157454
"sha512": "Bl6KYfbFSIW3QIRHAp931iR5h01qHjKghdpAtncwbzNUs0+IUZ+XfwkIU0sQsR33ufGvi3u4dZMIYYFysjpHAA==",
74167455
"type": "package",
@@ -13322,6 +13361,7 @@
1332213361
"": [
1332313362
"ApplicationParts.Controllers",
1332413363
"ApplicationParts.Web",
13364+
"Microsoft.DotNet.InternalAbstractions >= 1.0.0",
1332513365
"Microsoft.EntityFrameworkCore.InMemory >= 1.1.0",
1332613366
"MyTested.AspNetCore.Mvc.Controllers >= 1.1.0",
1332713367
"MyTested.AspNetCore.Mvc.Routing >= 1.1.0",

samples/Lite/Lite.Test/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
},
66

77
"dependencies": {
8+
"Microsoft.DotNet.InternalAbstractions": "1.0.0", // remove when not needed
89
"dotnet-test-xunit": "2.2.0-*",
910
"xunit": "2.2.0-*",
1011
"MyTested.AspNetCore.Mvc.Lite": "1.1.0",

samples/Lite/Lite.Test/project.lock.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,25 @@
876876
}
877877
}
878878
},
879+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
880+
"type": "package",
881+
"dependencies": {
882+
"System.AppContext": "4.1.0",
883+
"System.Collections": "4.0.11",
884+
"System.IO": "4.1.0",
885+
"System.IO.FileSystem": "4.0.1",
886+
"System.Reflection.TypeExtensions": "4.1.0",
887+
"System.Runtime.Extensions": "4.1.0",
888+
"System.Runtime.InteropServices": "4.1.0",
889+
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
890+
},
891+
"compile": {
892+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
893+
},
894+
"runtime": {
895+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
896+
}
897+
},
879898
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
880899
"type": "package",
881900
"dependencies": {
@@ -4798,6 +4817,15 @@
47984817
}
47994818
}
48004819
},
4820+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
4821+
"type": "package",
4822+
"compile": {
4823+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll": {}
4824+
},
4825+
"runtime": {
4826+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll": {}
4827+
}
4828+
},
48014829
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
48024830
"type": "package",
48034831
"compile": {
@@ -6818,6 +6846,17 @@
68186846
"runtimes/win8-arm/native/Microsoft.DiaSymReader.Native.arm.dll"
68196847
]
68206848
},
6849+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
6850+
"sha512": "AAguUq7YyKk3yDWPoWA8DrLZvURxB/LrDdTn1h5lmPeznkFUpfC3p459w5mQYQE0qpquf/CkSQZ0etiV5vRHFA==",
6851+
"type": "package",
6852+
"path": "Microsoft.DotNet.InternalAbstractions/1.0.0",
6853+
"files": [
6854+
"Microsoft.DotNet.InternalAbstractions.1.0.0.nupkg.sha512",
6855+
"Microsoft.DotNet.InternalAbstractions.nuspec",
6856+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll",
6857+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll"
6858+
]
6859+
},
68216860
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
68226861
"sha512": "Bl6KYfbFSIW3QIRHAp931iR5h01qHjKghdpAtncwbzNUs0+IUZ+XfwkIU0sQsR33ufGvi3u4dZMIYYFysjpHAA==",
68236862
"type": "package",
@@ -12587,6 +12626,7 @@
1258712626
"projectFileDependencyGroups": {
1258812627
"": [
1258912628
"Lite.Web",
12629+
"Microsoft.DotNet.InternalAbstractions >= 1.0.0",
1259012630
"Moq >= 4.6.38-*",
1259112631
"MyTested.AspNetCore.Mvc.Lite >= 1.1.0",
1259212632
"dotnet-test-xunit >= 2.2.0-*",

samples/MusicStore/MusicStore.Test/Controllers/ShoppingCartControllerTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void AddToCartShouldAddItemsToCart()
8585
.WithDbContext(db => db
8686
.WithEntities(entities => entities
8787
.AddRange(CreateTestAlbums(itemPrice: 10))))
88-
.Calling(c => c.AddToCart(albumId))
88+
.Calling(c => c.AddToCart(albumId, CancellationToken.None))
8989
.ShouldReturn()
9090
.Redirect()
9191
.To<ShoppingCartController>(c => c.Index())

samples/MusicStore/MusicStore.Test/Routing/ShoppingCartRouteTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void AddToCartShouldBeRoutedCorrectly()
2222
MyMvc
2323
.Routing()
2424
.ShouldMap("/ShoppingCart/AddToCart/1")
25-
.To<ShoppingCartController>(c => c.AddToCart(1));
25+
.To<ShoppingCartController>(c => c.AddToCart(1, With.Any<CancellationToken>()));
2626
}
2727

2828
[Fact]

samples/MusicStore/MusicStore.Test/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212

1313
"dependencies": {
14+
"Microsoft.DotNet.InternalAbstractions": "1.0.0", // remove when not needed
1415
"dotnet-test-xunit": "2.2.0-*",
1516
"xunit": "2.2.0-*",
1617
"MyTested.AspNetCore.Mvc.Universe": "1.1.0",

samples/MusicStore/MusicStore.Test/project.lock.json

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,25 @@
11031103
}
11041104
}
11051105
},
1106+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
1107+
"type": "package",
1108+
"dependencies": {
1109+
"System.AppContext": "4.1.0",
1110+
"System.Collections": "4.0.11",
1111+
"System.IO": "4.1.0",
1112+
"System.IO.FileSystem": "4.0.1",
1113+
"System.Reflection.TypeExtensions": "4.1.0",
1114+
"System.Runtime.Extensions": "4.1.0",
1115+
"System.Runtime.InteropServices": "4.1.0",
1116+
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0"
1117+
},
1118+
"compile": {
1119+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
1120+
},
1121+
"runtime": {
1122+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll": {}
1123+
}
1124+
},
11061125
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
11071126
"type": "package",
11081127
"dependencies": {
@@ -4359,7 +4378,7 @@
43594378
"lib/netstandard1.1/xunit.runner.utility.dotnet.dll": {}
43604379
}
43614380
},
4362-
"MusicStore.Web/1.0.0": {
4381+
"MusicStore.Web/1.1.0": {
43634382
"type": "project",
43644383
"framework": ".NETCoreApp,Version=v1.1",
43654384
"dependencies": {
@@ -5787,6 +5806,15 @@
57875806
}
57885807
}
57895808
},
5809+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
5810+
"type": "package",
5811+
"compile": {
5812+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll": {}
5813+
},
5814+
"runtime": {
5815+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll": {}
5816+
}
5817+
},
57905818
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
57915819
"type": "package",
57925820
"compile": {
@@ -7110,7 +7138,7 @@
71107138
"lib/net45/xunit.runner.utility.desktop.dll": {}
71117139
}
71127140
},
7113-
"MusicStore.Web/1.0.0": {
7141+
"MusicStore.Web/1.1.0": {
71147142
"type": "project",
71157143
"framework": ".NETFramework,Version=v4.5.1",
71167144
"dependencies": {
@@ -8409,6 +8437,17 @@
84098437
"runtimes/win8-arm/native/Microsoft.DiaSymReader.Native.arm.dll"
84108438
]
84118439
},
8440+
"Microsoft.DotNet.InternalAbstractions/1.0.0": {
8441+
"sha512": "AAguUq7YyKk3yDWPoWA8DrLZvURxB/LrDdTn1h5lmPeznkFUpfC3p459w5mQYQE0qpquf/CkSQZ0etiV5vRHFA==",
8442+
"type": "package",
8443+
"path": "Microsoft.DotNet.InternalAbstractions/1.0.0",
8444+
"files": [
8445+
"Microsoft.DotNet.InternalAbstractions.1.0.0.nupkg.sha512",
8446+
"Microsoft.DotNet.InternalAbstractions.nuspec",
8447+
"lib/net451/Microsoft.DotNet.InternalAbstractions.dll",
8448+
"lib/netstandard1.3/Microsoft.DotNet.InternalAbstractions.dll"
8449+
]
8450+
},
84128451
"Microsoft.DotNet.PlatformAbstractions/1.1.0": {
84138452
"sha512": "Bl6KYfbFSIW3QIRHAp931iR5h01qHjKghdpAtncwbzNUs0+IUZ+XfwkIU0sQsR33ufGvi3u4dZMIYYFysjpHAA==",
84148453
"type": "package",
@@ -14395,7 +14434,7 @@
1439514434
"xunit.runner.utility.nuspec"
1439614435
]
1439714436
},
14398-
"MusicStore.Web/1.0.0": {
14437+
"MusicStore.Web/1.1.0": {
1439914438
"type": "project",
1440014439
"path": "../MusicStore.Web/project.json",
1440114440
"msbuildProject": "../MusicStore.Web/MusicStore.Web.xproj"
@@ -14523,6 +14562,7 @@
1452314562
},
1452414563
"projectFileDependencyGroups": {
1452514564
"": [
14565+
"Microsoft.DotNet.InternalAbstractions >= 1.0.0",
1452614566
"MusicStore.Web",
1452714567
"MyTested.AspNetCore.Mvc.Universe >= 1.1.0",
1452814568
"dotnet-test-xunit >= 2.2.0-*",

src/MyTested.AspNetCore.Mvc.Abstractions/Internal/Application/TestApplication.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,21 +342,24 @@ private static IServiceCollection GetInitialServiceCollection()
342342
{
343343
var serviceCollection = new ServiceCollection();
344344
var diagnosticSource = new DiagnosticListener(TestFrameworkName);
345+
var applicationLifetime = new ApplicationLifetime();
345346

346347
// default server services
347-
serviceCollection.TryAddSingleton(Environment);
348+
serviceCollection.AddSingleton(Environment);
349+
serviceCollection.AddSingleton<IApplicationLifetime>(applicationLifetime);
348350

349-
serviceCollection.TryAddSingleton<ILoggerFactory>(LoggerFactoryMock.Create());
351+
serviceCollection.AddSingleton<ILoggerFactory>(LoggerFactoryMock.Create());
350352
serviceCollection.AddLogging();
351353

352354
serviceCollection.AddTransient<IApplicationBuilderFactory, ApplicationBuilderFactory>();
353-
serviceCollection.TryAddTransient<IHttpContextFactory, HttpContextFactory>();
355+
serviceCollection.AddTransient<IHttpContextFactory, HttpContextFactory>();
354356
serviceCollection.AddOptions();
355357

356-
serviceCollection.TryAddSingleton<DiagnosticSource>(diagnosticSource);
357-
serviceCollection.TryAddSingleton(diagnosticSource);
358+
serviceCollection.AddSingleton<DiagnosticSource>(diagnosticSource);
359+
serviceCollection.AddSingleton(diagnosticSource);
358360

359361
serviceCollection.AddTransient<IStartupFilter, AutoRequestServicesStartupFilter>();
362+
serviceCollection.AddTransient<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>();
360363

361364
serviceCollection.AddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>();
362365

src/MyTested.AspNetCore.Mvc.ViewActionResults/Builders/ActionResults/View/ViewComponentTestBuilder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace MyTested.AspNetCore.Mvc.Builders.ActionResults.View
22
{
3+
using System;
34
using System.Collections.Generic;
45
using System.Net;
56
using Contracts.ActionResults.View;
@@ -54,13 +55,15 @@ public ViewComponentTestBuilder(ControllerTestContext testContext)
5455
=> this.WithContentType(contentType?.MediaType);
5556

5657
/// <inheritdoc />
58+
[Obsolete("The ViewEngine property is unused and will be removed in the next major version of ASP.NET Core MVC.")]
5759
public new IAndViewComponentTestBuilder WithViewEngine(IViewEngine viewEngine)
5860
{
5961
base.WithViewEngine(viewEngine);
6062
return this;
6163
}
6264

6365
/// <inheritdoc />
66+
[Obsolete("The ViewEngine property is unused and will be removed in the next major version of ASP.NET Core MVC.")]
6467
public new IAndViewComponentTestBuilder WithViewEngineOfType<TViewEngine>()
6568
where TViewEngine : IViewEngine
6669
{

0 commit comments

Comments
 (0)