From b9fe9c2417f26fa6e1d9383b8fa9d50ff9a96d65 Mon Sep 17 00:00:00 2001 From: Jens Geyer Date: Thu, 3 Feb 2022 01:00:31 +0100 Subject: [PATCH] FIX: test left too early on false premise --- test/netstd/Client/Performance/PerformanceTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/netstd/Client/Performance/PerformanceTests.cs b/test/netstd/Client/Performance/PerformanceTests.cs index c1f00ddf80b..6ac3aed861a 100644 --- a/test/netstd/Client/Performance/PerformanceTests.cs +++ b/test/netstd/Client/Performance/PerformanceTests.cs @@ -132,10 +132,12 @@ private async Task RunTestAsync(Func> 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); @@ -146,6 +148,8 @@ private async Task RunTestAsync(Func> 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();