Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Reacting to hosting rename
Browse files Browse the repository at this point in the history
  • Loading branch information
JunTaoLuo committed Jan 18, 2016
1 parent 10fdfcc commit 0f9875d
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -27,3 +27,4 @@ nuget.exe
project.lock.json
.build/
.testPublish/
/.vs/
6 changes: 3 additions & 3 deletions samples/CookieSample/Startup.cs
Expand Up @@ -44,13 +44,13 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)

public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();

application.Run();
host.Run();
}
}
}
6 changes: 3 additions & 3 deletions samples/CookieSessionSample/Startup.cs
Expand Up @@ -54,13 +54,13 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)

public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();

application.Run();
host.Run();
}
}
}
6 changes: 3 additions & 3 deletions samples/JwtBearerSample/Startup.cs
Expand Up @@ -114,13 +114,13 @@ public void Configure(IApplicationBuilder app)
// Entry point for the application.
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();

application.Run();
host.Run();
}
}
}
6 changes: 3 additions & 3 deletions samples/OpenIdConnectSample/Startup.cs
Expand Up @@ -67,13 +67,13 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)

public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();

application.Run();
host.Run();
}
}
}
6 changes: 3 additions & 3 deletions samples/SocialSample/Startup.cs
Expand Up @@ -325,13 +325,13 @@ 127.0.0.1 MsSecSample.localhost.this

public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
var host = new WebHostBuilder()
.UseDefaultConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();

application.Run();
host.Run();
}
}
}
Expand Up @@ -854,7 +854,7 @@ public async Task CookieChallengeWithUnauthorizedRedirectsToLoginIfNotAuthentica
[Fact]
public async Task MapWillNotAffectChallenge()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -878,7 +878,7 @@ public async Task MapWillNotAffectChallenge()
[Fact]
public async Task ChallengeDoesNotSet401OnUnauthorized()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication();
Expand All @@ -897,7 +897,7 @@ public async Task ChallengeDoesNotSet401OnUnauthorized()
[Fact]
public async Task UseCookieWithInstanceDoesntUseSharedOptions()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -919,7 +919,7 @@ public async Task UseCookieWithInstanceDoesntUseSharedOptions()
[Fact]
public async Task MapWithSignInOnlyRedirectToReturnUrlOnLoginPath()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -940,7 +940,7 @@ public async Task MapWithSignInOnlyRedirectToReturnUrlOnLoginPath()
[Fact]
public async Task MapWillNotAffectSignInRedirectToReturnUrl()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -965,7 +965,7 @@ public async Task MapWillNotAffectSignInRedirectToReturnUrl()
[Fact]
public async Task MapWithSignOutOnlyRedirectToReturnUrlOnLogoutPath()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -985,7 +985,7 @@ public async Task MapWithSignOutOnlyRedirectToReturnUrlOnLogoutPath()
[Fact]
public async Task MapWillNotAffectSignOutRedirectToReturnUrl()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -1009,7 +1009,7 @@ public async Task MapWillNotAffectSignOutRedirectToReturnUrl()
[Fact]
public async Task MapWillNotAffectAccessDenied()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -1031,7 +1031,7 @@ public async Task MapWillNotAffectAccessDenied()
[Fact]
public async Task NestedMapWillNotAffectLogin()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
app.Map("/base", map =>
{
Expand All @@ -1055,7 +1055,7 @@ public async Task NestedMapWillNotAffectLogin()
[Fact]
public async Task NestedMapWillNotAffectAccessDenied()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
app.Map("/base", map =>
{
Expand All @@ -1080,7 +1080,7 @@ public async Task CanSpecifyAndShareDataProtector()
{

var dp = new NoOpDataProtector();
var builder1 = new WebApplicationBuilder()
var builder1 = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand All @@ -1099,7 +1099,7 @@ public async Task CanSpecifyAndShareDataProtector()
var transaction = await SendAsync(server1, "http://example.com/stuff");
Assert.NotNull(transaction.SetCookie);

var builder2 = new WebApplicationBuilder()
var builder2 = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand Down Expand Up @@ -1162,7 +1162,7 @@ private static async Task<XElement> GetAuthData(TestServer server, string url, s

private static TestServer CreateServer(CookieAuthenticationOptions options, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, ClaimsTransformationOptions claimsTransform = null)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(options);
Expand Down
Expand Up @@ -229,7 +229,7 @@ public async Task CustomUserInfoEndpointHasValidGraphQuery()

private static TestServer CreateServer(Action<IApplicationBuilder> configure, Action<IServiceCollection> configureServices, Func<HttpContext, bool> handler)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
if (configure != null)
Expand Down
Expand Up @@ -757,7 +757,7 @@ private static HttpResponseMessage ReturnJsonResponse(object content, HttpStatus

private static TestServer CreateServer(GoogleOptions options, Func<HttpContext, Task> testpath = null)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand Down
Expand Up @@ -535,7 +535,7 @@ public ClaimsPrincipal ValidateToken(string securityToken, TokenValidationParame

private static TestServer CreateServer(JwtBearerOptions options, Func<HttpContext, bool> handler = null)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
if (options != null)
Expand Down
Expand Up @@ -174,7 +174,7 @@ public async Task AuthenticatedEventCanGetRefreshToken()

private static TestServer CreateServer(MicrosoftAccountOptions options)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand Down
Expand Up @@ -98,7 +98,7 @@ private static OpenIdConnectOptions GetStateOptions()

private static TestServer CreateServer(OpenIdConnectOptions options, UrlEncoder encoder, OpenIdConnectHandler handler = null)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseMiddleware<OpenIdConnectMiddlewareForTestingAuthenticate>(Options.Create(options), encoder, handler);
Expand Down
Expand Up @@ -377,7 +377,7 @@ public async Task SignOutWith_Specific_RedirectUri_From_Authentication_Properite

private static TestServer CreateServer(OpenIdConnectOptions options, Func<HttpContext, Task> handler = null, AuthenticationProperties properties = null)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand Down
Expand Up @@ -152,7 +152,7 @@ public async Task ChallengeWillTriggerRedirection()

private static TestServer CreateServer(TwitterOptions options, Func<HttpContext, bool> handler = null)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new CookieAuthenticationOptions
Expand Down
8 changes: 4 additions & 4 deletions test/Microsoft.AspNet.CookiePolicy.Test/CookiePolicyTests.cs
Expand Up @@ -145,7 +145,7 @@ public async Task HttpOnlyNoneLeavesItAlone()
[Fact]
public async Task CookiePolicyCanHijackAppend()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookiePolicy(new CookiePolicyOptions
Expand Down Expand Up @@ -175,7 +175,7 @@ public async Task CookiePolicyCanHijackAppend()
[Fact]
public async Task CookiePolicyCanHijackDelete()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookiePolicy(new CookiePolicyOptions
Expand Down Expand Up @@ -203,7 +203,7 @@ public async Task CookiePolicyCanHijackDelete()
[Fact]
public async Task CookiePolicyCallsCookieFeature()
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.Use(next => context =>
Expand Down Expand Up @@ -282,7 +282,7 @@ public async Task Execute(TestServer server)
RequestDelegate configureSetup,
params RequestTest[] tests)
{
var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.Map(path, map =>
Expand Down
Expand Up @@ -52,7 +52,7 @@ public async Task AspNet5WithInteropCookieContainsIdentity()

var transaction = await SendAsync(interopServer, "http://example.com");

var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions
Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task InteropWithNewCookieContainsIdentity()
"Microsoft.AspNet.Authentication.Cookies.CookieAuthenticationMiddleware", // full name of the ASP.NET 5 type
CookieAuthenticationDefaults.AuthenticationType, "v2");

var builder = new WebApplicationBuilder()
var builder = new WebHostBuilder()
.Configure(app =>
{
app.UseCookieAuthentication(new AspNet.Builder.CookieAuthenticationOptions
Expand Down

0 comments on commit 0f9875d

Please sign in to comment.