protected override async Task When() { await Subject.Send(new FooCommand()); await Timeout.WaitUntil(() => MethodCallCounter.TotalReceivedCalls >= _expectedTotalCallCount); MethodCallCounter.Stop(); MethodCallCounter.Dump(); }
public virtual void TestFixtureSetUp() { Task.Run(async() => { MethodCallCounter.Clear(); Subject = await Given(); _sw = Stopwatch.StartNew(); try { await When(); } finally { _sw.Stop(); Console.WriteLine("Elapsed time: {0} seconds", _sw.Elapsed.TotalSeconds); MethodCallCounter.Dump(); } }).Wait(); }