Skip to content

Commit

Permalink
FIX: test left too early on false premise
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens-G committed Feb 3, 2022
1 parent f087ec4 commit b9fe9c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/netstd/Client/Performance/PerformanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ private async Task RunTestAsync(Func<bool, Task<TProtocol>> factory)
{
var stop = new Stopwatch();

if ((Testdata is null) || (Transport is null))
if (Testdata is null)
throw new Exception("unexpected internal state");

var proto = await factory(true);
if (Transport is null)
throw new Exception("unexpected internal state");
stop.Start();
await Testdata.WriteAsync(proto, Cancel.Token);
await Transport.FlushAsync(Cancel.Token);
Expand All @@ -146,6 +148,8 @@ private async Task RunTestAsync(Func<bool, Task<TProtocol>> factory)

var restored = new CrazyNesting();
proto = await factory(false);
if (Transport is null)
throw new Exception("unexpected internal state");
stop.Start();
await restored.ReadAsync(proto, Cancel.Token);
stop.Stop();
Expand Down

0 comments on commit b9fe9c2

Please sign in to comment.