For a test code similar to
Assert.ThrowsExactly<SomeException>(() => foo.BarAsync().GetAwaiter().GetResult());
add an analyzer rule to favor
await Assert.ThrowsExactlyAsync<SomeException>(() => foo.BarAsync());
also adjusting the test method signature, if needed.