Skip to content

Commit

Permalink
#4208 Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed Sep 6, 2024
1 parent 69f4032 commit 099a361
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Source/Csla.Blazor.Test/AppContext/ContextManagerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void UseAsyncLocalApplicationContextManager()
}

[TestMethod]
public void UseAspNetCoreApplicationContextManager()
public void UseBlazorApplicationContextManager()
{
var services = new ServiceCollection();
services.AddScoped<AuthenticationStateProvider, AuthenticationStateProviderFake>();
Expand All @@ -90,6 +90,23 @@ public void UseAspNetCoreApplicationContextManager()
var activeState = serviceProvider.GetRequiredService<AspNetCore.Blazor.ActiveCircuitState>();
activeState.CircuitExists = false;

var applicationContext = serviceProvider.GetRequiredService<ApplicationContext>();
Assert.IsInstanceOfType(applicationContext.ContextManager, typeof(Csla.AspNetCore.Blazor.ApplicationContextManagerBlazor));
}

[TestMethod]
public void UseAspNetCoreApplicationContextManager()
{
var services = new ServiceCollection();
services.AddScoped<AuthenticationStateProvider, AuthenticationStateProviderFake>();
services.AddScoped<IHttpContextAccessor, HttpContextAccessorFake>();
services.AddCsla(o => o
.AddAspNetCore());
var serviceProvider = services.BuildServiceProvider();

var activeState = serviceProvider.GetRequiredService<AspNetCore.Blazor.ActiveCircuitState>();
activeState.CircuitExists = false;

var applicationContext = serviceProvider.GetRequiredService<ApplicationContext>();
Assert.IsInstanceOfType(applicationContext.ContextManager, typeof(Csla.AspNetCore.ApplicationContextManagerHttpContext));
}
Expand Down

0 comments on commit 099a361

Please sign in to comment.