Ejemplo n.º 1
0
 public AuthTest(
     BrowserFixture browserFixture,
     ToggleExecutionModeServerFixture <Program> serverFixture,
     ITestOutputHelper output)
     : base(browserFixture, serverFixture, output)
 {
     // Normally, the E2E tests use the Blazor dev server if they are testing
     // client-side execution. But for the auth tests, we always have to run
     // in "hosted on ASP.NET Core" mode, because we get the auth state from it.
     serverFixture.UseAspNetHost(TestServer.Program.BuildWebHost);
 }
Ejemplo n.º 2
0
        protected AuthTest(
            BrowserFixture browserFixture,
            ToggleExecutionModeServerFixture <Program> serverFixture,
            ITestOutputHelper output,
            ExecutionMode executionMode)
            : base(browserFixture, serverFixture, output)
        {
            // Normally, the E2E tests use the Blazor dev server if they are testing
            // client-side execution. But for the auth tests, we always have to run
            // in "hosted on ASP.NET Core" mode, because we get the auth state from it.
            switch (executionMode)
            {
            case ExecutionMode.Client:
                serverFixture.UseAspNetHost(TestServer.Program.BuildWebHost <TestServer.AuthenticationStartup>);
                break;

            case ExecutionMode.Server:
                serverFixture.UseAspNetHost(TestServer.Program.BuildWebHost <TestServer.ServerAuthenticationStartup>);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 3
0
 public static ToggleExecutionModeServerFixture <T> WithServerExecution <T, TStartup>(this ToggleExecutionModeServerFixture <T> serverFixture) where TStartup : class
 {
     serverFixture.UseAspNetHost(Program.BuildWebHost <TStartup>);
     serverFixture.ExecutionMode = ExecutionMode.Server;
     return(serverFixture);
 }
 public static ToggleExecutionModeServerFixture <T> WithServerExecution <T>(this ToggleExecutionModeServerFixture <T> serverFixture)
 {
     serverFixture.UseAspNetHost(TestServer.Program.BuildWebHost);
     return(serverFixture);
 }