New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/assertionscope #1091
Feature/assertionscope #1091
Conversation
Looks like the tests need updated to support threading. On it |
Sorry about the one file per commit "commits" right now. Work VPN doesn't want to let me log in via bash or gh desktop |
All comments addressed |
The revised implementation looks great to me 👍. Now to verification. I've tried to come up with a test to verify that the changes are also an improvement over master. [Fact]
public async Task When_using_AssertionScope_across_thread_boundaries_it_should_work()
{
using (var semaphore = new SemaphoreSlim(0, 1))
{
await Task.WhenAll(First(semaphore), Second(semaphore));
}
}
private static async Task First(SemaphoreSlim semaphore)
{
await Task.Yield();
var scope = new AssertionScope();
await semaphore.WaitAsync();
scope.Should().BeSameAs(AssertionScope.Current);
}
private static async Task Second(SemaphoreSlim semaphore)
{
await Task.Yield();
var scope = new AssertionScope();
semaphore.Release();
scope.Should().BeSameAs(AssertionScope.Current);
} |
Adding Tests for boundaries
Added Tests |
Is there anything else you need in order to get this merged? |
Adds safety to tests using AssertionScope while running many tests in parallel
IMPORTANT