@page "/MyTests/TestExample"
@inherits IcuBlazor.IcuTestSuite
@code {
public void SimpleChecks(Checker check)
{
check.True(2 < 3, "a true test");
check.False(2 == 3, "a false test");
check.Equal(6*9, 42, "What's the question?");
}
async Task Test_async_method(Checker check)
{
var t0 = DateTime.Now;
await Task.Delay(500);
var dt = (DateTime.Now - t0).TotalMilliseconds;
check.True(dt<550, $"async test waited {dt} ms");
}
}
What if assertion tests were more than pass/fail operations? What if asserts produced Blazor components? This would allow us to do some powerful things. For example, we could produce visual diffs and enable interactive testing.