Feature/assertionscope#1091
Feature/assertionscope#1091dennisdoomen merged 17 commits intofluentassertions:masterfrom conklinb:feature/assertionscope
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