Uncomment test code and change ASPNET_ENV to ASPNETCORE_ENVIRONMENT
This commit is contained in:
parent
0d34e36ee9
commit
a3fca566c5
|
|
@ -92,7 +92,7 @@ namespace MusicStore
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//This method is invoked when ASPNET_ENV is 'Development' or is not defined
|
//This method is invoked when ASPNETCORE_ENVIRONMENT is 'Development' or is not defined
|
||||||
//The allowed values are Development,Staging and Production
|
//The allowed values are Development,Staging and Production
|
||||||
public void ConfigureDevelopment(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
public void ConfigureDevelopment(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
|
|
@ -115,7 +115,7 @@ namespace MusicStore
|
||||||
Configure(app);
|
Configure(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
//This method is invoked when ASPNET_ENV is 'Staging'
|
//This method is invoked when ASPNETCORE_ENVIRONMENT is 'Staging'
|
||||||
//The allowed values are Development,Staging and Production
|
//The allowed values are Development,Staging and Production
|
||||||
public void ConfigureStaging(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
public void ConfigureStaging(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
|
|
@ -129,7 +129,7 @@ namespace MusicStore
|
||||||
Configure(app);
|
Configure(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
//This method is invoked when ASPNET_ENV is 'Production'
|
//This method is invoked when ASPNETCORE_ENVIRONMENT is 'Production'
|
||||||
//The allowed values are Development,Staging and Production
|
//The allowed values are Development,Staging and Production
|
||||||
public void ConfigureProduction(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
public void ConfigureProduction(IApplicationBuilder app, ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,18 @@ namespace MusicStore
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// To make runtime to load an environment based startup class, specify the environment by the following ways:
|
/// To make runtime to load an environment based startup class, specify the environment by the following ways:
|
||||||
/// 1. Drop a Microsoft.AspNetCore.Hosting.ini file in the wwwroot folder
|
/// 1. Drop a Microsoft.AspNetCore.Hosting.ini file in the wwwroot folder
|
||||||
/// 2. Add a setting in the ini file named 'ASPNET_ENV' with value of the format 'Startup[EnvironmentName]'.
|
/// 2. Add a setting in the ini file named 'ASPNETCORE_ENVIRONMENT' with value of the format 'Startup[EnvironmentName]'.
|
||||||
/// For example: To load a Startup class named 'StartupNtlmAuthentication' the value of the env should be
|
/// For example: To load a Startup class named 'StartupNtlmAuthentication' the value of the env should be
|
||||||
/// 'NtlmAuthentication' (eg. ASPNET_ENV=NtlmAuthentication). Runtime adds a 'Startup' prefix to this and
|
/// 'NtlmAuthentication' (eg. ASPNETCORE_ENVIRONMENT=NtlmAuthentication). Runtime adds a 'Startup' prefix to this and
|
||||||
/// loads 'StartupNtlmAuthentication'.
|
/// loads 'StartupNtlmAuthentication'.
|
||||||
/// If no environment name is specified the default startup class loaded is 'Startup'.
|
/// If no environment name is specified the default startup class loaded is 'Startup'.
|
||||||
///
|
///
|
||||||
/// Alternative ways to specify environment are:
|
/// Alternative ways to specify environment are:
|
||||||
/// 1. Set the environment variable named SET ASPNET_ENV=NtlmAuthentication
|
/// 1. Set the environment variable named SET ASPNETCORE_ENVIRONMENT=NtlmAuthentication
|
||||||
/// 2. For selfhost based servers pass in a command line variable named --env with this value. Eg:
|
/// 2. For selfhost based servers pass in a command line variable named --env with this value. Eg:
|
||||||
/// "commands": {
|
/// "commands": {
|
||||||
/// "web": "Microsoft.AspNetCore.Hosting --server Microsoft.AspNetCore.Server.WebListener
|
/// "web": "Microsoft.AspNetCore.Hosting --server Microsoft.AspNetCore.Server.WebListener
|
||||||
/// --server.urls http://localhost:5002 --ASPNET_ENV NtlmAuthentication",
|
/// --server.urls http://localhost:5002 --ASPNETCORE_ENVIRONMENT NtlmAuthentication",
|
||||||
/// },
|
/// },
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StartupNtlmAuthentication
|
public class StartupNtlmAuthentication
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,14 @@ namespace MusicStore
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// To make runtime to load an environment based startup class, specify the environment by the following ways:
|
/// To make runtime to load an environment based startup class, specify the environment by the following ways:
|
||||||
/// 1. Drop a Microsoft.AspNetCore.Hosting.ini file in the wwwroot folder
|
/// 1. Drop a Microsoft.AspNetCore.Hosting.ini file in the wwwroot folder
|
||||||
/// 2. Add a setting in the ini file named 'ASPNET_ENV' with value of the format 'Startup[EnvironmentName]'.
|
/// 2. Add a setting in the ini file named 'ASPNETCORE_ENVIRONMENT' with value of the format 'Startup[EnvironmentName]'.
|
||||||
/// For example: To load a Startup class named 'StartupOpenIdConnect' the value of the env should be
|
/// For example: To load a Startup class named 'StartupOpenIdConnect' the value of the env should be
|
||||||
/// 'OpenIdConnect' (eg. ASPNET_ENV=OpenIdConnect). Runtime adds a 'Startup' prefix to this
|
/// 'OpenIdConnect' (eg. ASPNETCORE_ENVIRONMENT=OpenIdConnect). Runtime adds a 'Startup' prefix to this
|
||||||
/// and loads 'StartupOpenIdConnect'.
|
/// and loads 'StartupOpenIdConnect'.
|
||||||
///
|
///
|
||||||
/// If no environment name is specified the default startup class loaded is 'Startup'.
|
/// If no environment name is specified the default startup class loaded is 'Startup'.
|
||||||
/// Alternative ways to specify environment are:
|
/// Alternative ways to specify environment are:
|
||||||
/// 1. Set the environment variable named SET ASPNET_ENV=OpenIdConnect
|
/// 1. Set the environment variable named SET ASPNETCORE_ENVIRONMENT=OpenIdConnect
|
||||||
/// 2. For selfhost based servers pass in a command line variable named --env with this value. Eg:
|
/// 2. For selfhost based servers pass in a command line variable named --env with this value. Eg:
|
||||||
/// "commands": {
|
/// "commands": {
|
||||||
/// "web": "Microsoft.AspNetCore.Hosting --server Microsoft.AspNetCore.Server.WebListener
|
/// "web": "Microsoft.AspNetCore.Hosting --server Microsoft.AspNetCore.Server.WebListener
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -39,7 +40,10 @@ namespace E2ETests
|
||||||
Assert.Equal<string>("ValidStateData", queryItems["state"]);
|
Assert.Equal<string>("ValidStateData", queryItems["state"]);
|
||||||
Assert.Equal<string>("custom", queryItems["custom_redirect_uri"]);
|
Assert.Equal<string>("custom", queryItems["custom_redirect_uri"]);
|
||||||
//Check for the correlation cookie
|
//Check for the correlation cookie
|
||||||
//Assert.NotNull(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Facebook"));
|
Assert.NotEmpty(
|
||||||
|
_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri))
|
||||||
|
.Cast<Cookie>()
|
||||||
|
.Where(cookie => cookie.Name.StartsWith(".AspNetCore.Correlation.Facebook")));
|
||||||
|
|
||||||
//This is just to generate a correlation cookie. Previous step would generate this cookie, but we have reset the handler now.
|
//This is just to generate a correlation cookie. Previous step would generate this cookie, but we have reset the handler now.
|
||||||
_httpClientHandler = new HttpClientHandler();
|
_httpClientHandler = new HttpClientHandler();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -40,7 +41,10 @@ namespace E2ETests
|
||||||
Assert.Equal<string>("ValidStateData", queryItems["state"]);
|
Assert.Equal<string>("ValidStateData", queryItems["state"]);
|
||||||
Assert.Equal<string>("custom", queryItems["custom_redirect_uri"]);
|
Assert.Equal<string>("custom", queryItems["custom_redirect_uri"]);
|
||||||
//Check for the correlation cookie
|
//Check for the correlation cookie
|
||||||
//Assert.NotNull(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Google"));
|
Assert.NotEmpty(
|
||||||
|
_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri))
|
||||||
|
.Cast<Cookie>()
|
||||||
|
.Where(cookie => cookie.Name.StartsWith(".AspNetCore.Correlation.Google")));
|
||||||
|
|
||||||
//This is just to generate a correlation cookie. Previous step would generate this cookie, but we have reset the handler now.
|
//This is just to generate a correlation cookie. Previous step would generate this cookie, but we have reset the handler now.
|
||||||
_httpClientHandler = new HttpClientHandler();
|
_httpClientHandler = new HttpClientHandler();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
@ -40,7 +41,10 @@ namespace E2ETests
|
||||||
Assert.Equal<string>("custom", queryItems["custom_redirect_uri"]);
|
Assert.Equal<string>("custom", queryItems["custom_redirect_uri"]);
|
||||||
|
|
||||||
//Check for the correlation cookie
|
//Check for the correlation cookie
|
||||||
//Assert.NotNull(_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri)).GetCookieWithName(".AspNetCore.Correlation.Microsoft"));
|
Assert.NotEmpty(
|
||||||
|
_httpClientHandler.CookieContainer.GetCookies(new Uri(_deploymentResult.ApplicationBaseUri))
|
||||||
|
.Cast<Cookie>()
|
||||||
|
.Where(cookie => cookie.Name.StartsWith(".AspNetCore.Correlation.Microsoft")));
|
||||||
|
|
||||||
//This is just to generate a correlation cookie. Previous step would generate this cookie, but we have reset the handler now.
|
//This is just to generate a correlation cookie. Previous step would generate this cookie, but we have reset the handler now.
|
||||||
_httpClientHandler = new HttpClientHandler();
|
_httpClientHandler = new HttpClientHandler();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue