Exemplo n.º 1
0
            public void CancelsDelays()
            {
                bool cancelled = false;

                DelayCancellation.AsObservable().Subscribe(_ => cancelled = true);

                StateMachine.Freeze();

                cancelled.Should().BeTrue();
            }
Exemplo n.º 2
0
            public void CancelsDelaysOnlyOnceWhenFreezeIsCalledMultipleTimes()
            {
                int cancelled = 0;

                DelayCancellation.AsObservable().Subscribe(_ => cancelled++);

                StateMachine.Freeze();
                StateMachine.Freeze();
                StateMachine.Freeze();

                cancelled.Should().Be(1);
            }