Imagine I have the following class and I want to test both, the firstRender = false
and the firstRender=true
"path". For this sake I am using bunit and xunit.
public class ToTest {
protected async override void OnAfterRender(bool firstRender)
{
if(firstRender)
{
//do stuff
}
else
{
//do other stuff
}
}
}
public class TestClass : TestContext
{
[Fact]
public void Test()
{
//Arrange stuff before this method
var cut = RenderComponent<News>(parameters => parameters
.Add(p => p.authenticationStateTask, stateProvider.GetAuthenticationStateAsync()));
}
}
Is there a way to set the firstRender-Variable of the OnAfterRender method in bunit testing? Do I have to adjust the RenderComponent-Parameters?