A testing library for Blazor components. Get started testing Blazor components at bunit.egilhansen.com/docs/getting-started/
@page
directive in components though, so the navigation step will have to be manual.
var page1 = RenderCompoent<Page1>()
and var page2 = RenderComponent<Page2>()
in the same test class.
TestContext.RenderTree
, if that is how you share state.
cut.WaitForAssertion(() => /* assertion goes here */)
since the test code runs in one thread and the component and renderer in another, to avoid deadlocks.
[Inject]
private IState<CounterState> CounterState { get; set; } https://github.com/mrpmorris/Fluxor/blob/master/Tutorials/02-Blazor/02A-StateActionsReducersTutorial/README.md
IState
, and then in your test, write Services.AddSingleton<IState<CounterState>>(new FakeState(....))