I am trying to test the blazorCulture change using Bunit Test but I am unable to get and set the blazorCulture.
Below code works in the actual blazor Wasm application but not working within a Bunit
var js = Services.GetRequiredService<IJSRuntime>();
var result = await js.InvokeAsync<string>("blazorCulture.get");
if (result != null)
{
CultureInfo.CurrentCulture = new CultureInfo(result);
}
else
{
CultureInfo.CurrentCulture = new CultureInfo("de-De");
await js.InvokeVoidAsync("blazorCulture.set", "de-De");
}
What is the way to change the Rendered Components culture and language using Bunit test?