| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- commit 90eca80e0bb19d37dfe9791aeced8758b280ead4
- Author: Javier Calvarro Nelson <[email protected]>
- Date: Mon Mar 19 15:35:00 2018 -0700
- React to changes in MVC Testing
- diff --git a/samples/ClaimsTransformation/Program.cs b/samples/ClaimsTransformation/Program.cs
- index 91cd418a051..2e80b153155 100644
- --- a/samples/ClaimsTransformation/Program.cs
- +++ b/samples/ClaimsTransformation/Program.cs
- @@ -14,12 +14,13 @@ namespace AuthSamples.ClaimsTransformer
- {
- public static void Main(string[] args)
- {
- - BuildWebHost(args).Run();
- + CreateWebHostBuilder(args)
- + .Build()
- + .Run();
- }
-
- - public static IWebHost BuildWebHost(string[] args) =>
- + public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- - .UseStartup<Startup>()
- - .Build();
- + .UseStartup<Startup>();
- }
- }
- diff --git a/samples/Cookies/Program.cs b/samples/Cookies/Program.cs
- index 2bb34d98ceb..bea350e31d8 100644
- --- a/samples/Cookies/Program.cs
- +++ b/samples/Cookies/Program.cs
- @@ -14,12 +14,13 @@ namespace AuthSamples.Cookies
- {
- public static void Main(string[] args)
- {
- - BuildWebHost(args).Run();
- + CreateWebHostBuilder(args)
- + .Build()
- + .Run();
- }
-
- - public static IWebHost BuildWebHost(string[] args) =>
- + public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- - .UseStartup<Startup>()
- - .Build();
- + .UseStartup<Startup>();
- }
- }
- diff --git a/samples/DynamicSchemes/Program.cs b/samples/DynamicSchemes/Program.cs
- index ecb4c007741..1cc18672afe 100644
- --- a/samples/DynamicSchemes/Program.cs
- +++ b/samples/DynamicSchemes/Program.cs
- @@ -14,12 +14,13 @@ namespace AuthSamples.DynamicSchemes
- {
- public static void Main(string[] args)
- {
- - BuildWebHost(args).Run();
- + CreateWebHostBuilder(args)
- + .Build()
- + .Run();
- }
-
- - public static IWebHost BuildWebHost(string[] args) =>
- + public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- - .UseStartup<Startup>()
- - .Build();
- + .UseStartup<Startup>();
- }
- }
- diff --git a/samples/Identity.ExternalClaims/Program.cs b/samples/Identity.ExternalClaims/Program.cs
- index 37a3281287f..d65f6c66c33 100644
- --- a/samples/Identity.ExternalClaims/Program.cs
- +++ b/samples/Identity.ExternalClaims/Program.cs
- @@ -14,12 +14,11 @@ namespace Identity.ExternalClaims
- {
- public static void Main(string[] args)
- {
- - BuildWebHost(args).Run();
- + CreateWebHostBuilder(args).Build().Run();
- }
-
- - public static IWebHost BuildWebHost(string[] args) =>
- + public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- - .UseStartup<Startup>()
- - .Build();
- + .UseStartup<Startup>();
- }
- }
- diff --git a/samples/PathSchemeSelection/Program.cs b/samples/PathSchemeSelection/Program.cs
- index 424cb8c9bce..c5d428cc02e 100644
- --- a/samples/PathSchemeSelection/Program.cs
- +++ b/samples/PathSchemeSelection/Program.cs
- @@ -14,12 +14,11 @@ namespace AuthSamples.PathSchemeSelection
- {
- public static void Main(string[] args)
- {
- - BuildWebHost(args).Run();
- + CreateWebHostBuilder(args).Build().Run();
- }
-
- - public static IWebHost BuildWebHost(string[] args) =>
- + public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- - .UseStartup<Startup>()
- - .Build();
- + .UseStartup<Startup>();
- }
- }
- diff --git a/test/AuthSamples.FunctionalTests/ClaimsTransformTests.cs b/test/AuthSamples.FunctionalTests/ClaimsTransformTests.cs
- index 003360bdb2d..d402a2b56dc 100644
- --- a/test/AuthSamples.FunctionalTests/ClaimsTransformTests.cs
- +++ b/test/AuthSamples.FunctionalTests/ClaimsTransformTests.cs
- @@ -4,15 +4,16 @@
- using System.Net;
- using System.Net.Http;
- using System.Threading.Tasks;
- +using Microsoft.AspNetCore.Mvc.Testing;
- using Xunit;
-
- namespace AuthSamples.FunctionalTests
- {
- - public class ClaimsTransformTests : IClassFixture<SampleTestFixture<ClaimsTransformer.Startup>>
- + public class ClaimsTransformTests : IClassFixture<WebApplicationFactory<ClaimsTransformer.Startup>>
- {
- - public ClaimsTransformTests(SampleTestFixture<ClaimsTransformer.Startup> fixture)
- + public ClaimsTransformTests(WebApplicationFactory<ClaimsTransformer.Startup> fixture)
- {
- - Client = fixture.Client;
- + Client = fixture.CreateDefaultClient();
- }
-
- public HttpClient Client { get; }
- diff --git a/test/AuthSamples.FunctionalTests/CookiesTests.cs b/test/AuthSamples.FunctionalTests/CookiesTests.cs
- index 13cf85a0358..c8e9dd93a6f 100644
- --- a/test/AuthSamples.FunctionalTests/CookiesTests.cs
- +++ b/test/AuthSamples.FunctionalTests/CookiesTests.cs
- @@ -4,15 +4,16 @@
- using System.Net;
- using System.Net.Http;
- using System.Threading.Tasks;
- +using Microsoft.AspNetCore.Mvc.Testing;
- using Xunit;
-
- namespace AuthSamples.FunctionalTests
- {
- - public class CookiesTests : IClassFixture<SampleTestFixture<Cookies.Startup>>
- + public class CookiesTests : IClassFixture<WebApplicationFactory<Cookies.Startup>>
- {
- - public CookiesTests(SampleTestFixture<Cookies.Startup> fixture)
- + public CookiesTests(WebApplicationFactory<Cookies.Startup> fixture)
- {
- - Client = fixture.Client;
- + Client = fixture.CreateDefaultClient();
- }
-
- public HttpClient Client { get; }
- diff --git a/test/AuthSamples.FunctionalTests/DynamicSchemeTests.cs b/test/AuthSamples.FunctionalTests/DynamicSchemeTests.cs
- index c8925341268..6b36267df5a 100644
- --- a/test/AuthSamples.FunctionalTests/DynamicSchemeTests.cs
- +++ b/test/AuthSamples.FunctionalTests/DynamicSchemeTests.cs
- @@ -4,15 +4,16 @@
- using System.Net;
- using System.Net.Http;
- using System.Threading.Tasks;
- +using Microsoft.AspNetCore.Mvc.Testing;
- using Xunit;
-
- namespace AuthSamples.FunctionalTests
- {
- - public class DynamicSchemeTests : IClassFixture<SampleTestFixture<DynamicSchemes.Startup>>
- + public class DynamicSchemeTests : IClassFixture<WebApplicationFactory<DynamicSchemes.Startup>>
- {
- - public DynamicSchemeTests(SampleTestFixture<DynamicSchemes.Startup> fixture)
- + public DynamicSchemeTests(WebApplicationFactory<DynamicSchemes.Startup> fixture)
- {
- - Client = fixture.Client;
- + Client = fixture.CreateDefaultClient();
- }
-
- public HttpClient Client { get; }
- diff --git a/test/AuthSamples.FunctionalTests/IdentityExternalClaimsTests.cs b/test/AuthSamples.FunctionalTests/IdentityExternalClaimsTests.cs
- index ba99876a55d..e91874ac061 100644
- --- a/test/AuthSamples.FunctionalTests/IdentityExternalClaimsTests.cs
- +++ b/test/AuthSamples.FunctionalTests/IdentityExternalClaimsTests.cs
- @@ -4,15 +4,16 @@
- using System.Net;
- using System.Net.Http;
- using System.Threading.Tasks;
- +using Microsoft.AspNetCore.Mvc.Testing;
- using Xunit;
-
- namespace AuthSamples.FunctionalTests
- {
- - public class IdentityExternalClaimsTests : IClassFixture<SampleTestFixture<Identity.ExternalClaims.Startup>>
- + public class IdentityExternalClaimsTests : IClassFixture<WebApplicationFactory<Identity.ExternalClaims.Startup>>
- {
- - public IdentityExternalClaimsTests(SampleTestFixture<Identity.ExternalClaims.Startup> fixture)
- + public IdentityExternalClaimsTests(WebApplicationFactory<Identity.ExternalClaims.Startup> fixture)
- {
- - Client = fixture.Client;
- + Client = fixture.CreateDefaultClient();
- }
-
- public HttpClient Client { get; }
- diff --git a/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs b/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs
- index 7a9f64f5b8e..9a3246575e6 100644
- --- a/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs
- +++ b/test/AuthSamples.FunctionalTests/PathSchemeSelectionTests.cs
- @@ -4,15 +4,16 @@
- using System.Net;
- using System.Net.Http;
- using System.Threading.Tasks;
- +using Microsoft.AspNetCore.Mvc.Testing;
- using Xunit;
-
- namespace AuthSamples.FunctionalTests
- {
- - public class PathSchemeSelectionTests : IClassFixture<SampleTestFixture<PathSchemeSelection.Startup>>
- + public class PathSchemeSelectionTests : IClassFixture<WebApplicationFactory<PathSchemeSelection.Startup>>
- {
- - public PathSchemeSelectionTests(SampleTestFixture<PathSchemeSelection.Startup> fixture)
- + public PathSchemeSelectionTests(WebApplicationFactory<PathSchemeSelection.Startup> fixture)
- {
- - Client = fixture.Client;
- + Client = fixture.CreateDefaultClient();
- }
-
- public HttpClient Client { get; }
- diff --git a/test/AuthSamples.FunctionalTests/SampleTestFixture.cs b/test/AuthSamples.FunctionalTests/SampleTestFixture.cs
- deleted file mode 100644
- index 365c976e78d..00000000000
- --- a/test/AuthSamples.FunctionalTests/SampleTestFixture.cs
- +++ /dev/null
- @@ -1,13 +0,0 @@
- -// Copyright (c) .NET Foundation. All rights reserved.
- -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
- -
- -using System.IO;
- -using Microsoft.AspNetCore.Mvc.Testing;
- -
- -namespace AuthSamples.FunctionalTests
- -{
- - public class SampleTestFixture<TStartup> : WebApplicationTestFixture<TStartup> where TStartup : class
- - {
- - public SampleTestFixture() : base(Path.Combine("samples", typeof(TStartup).Assembly.GetName().Name)) { }
- - }
- -}
- diff --git a/test/AuthSamples.FunctionalTests/xunit.runner.json b/test/AuthSamples.FunctionalTests/xunit.runner.json
- new file mode 100644
- index 00000000000..42db7ef95e9
- --- /dev/null
- +++ b/test/AuthSamples.FunctionalTests/xunit.runner.json
- @@ -0,0 +1,3 @@
- +{
- + "shadowCopy": false
- +}
|