コード例 #1
0
        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);
        }
コード例 #2
0
        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>());
        }
コード例 #3
0
        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);
            }
        }