public void Report1() { var report = Substitute.For <Action <int> >(); Coroutines.Report coroutine = new Coroutines.Report.Entry(1, report); coroutine = coroutine.Run(); coroutine = coroutine.Run(); coroutine.Completed.Should().BeTrue(); report.Received(1).Invoke(1); }
public void Report0() { var report = Substitute.For <Action <int> >(); Coroutines.Report coroutine = new Coroutines.Report.Entry(0, report); coroutine = coroutine.Run(); coroutine.Completed.Should().BeTrue(); report.DidNotReceive().Invoke(Arg.Any <int>()); }
private IEnumerable <Coroutines.Report> StartReport(int count) { Coroutines.Report coroutine = new Coroutines.Report.Entry(count, number => {}); yield return(coroutine); while (!coroutine.Completed) { coroutine = coroutine.Run(); yield return(coroutine); } }