public void wait_while_paused_completes_immediately_if_not_paused()
 {
     var sut = new ExecutionContext();
     var completed = false;
     sut
         .WaitWhilePaused()
         .Subscribe(_ => completed = true);
     Assert.True(completed);
 }
        public void wait_while_paused_does_not_complete_if_the_context_is_cancelled()
        {
            var sut = new ExecutionContext();
            sut.IsPaused = true;

            var executed = false;
            sut
                .WaitWhilePaused()
                .Subscribe(_ => executed = true);

            sut.Cancel();
            Assert.False(executed);
        }
        public void wait_while_paused_waits_until_unpaused()
        {
            var sut = new ExecutionContext();
            sut.IsPaused = true;

            var executed = false;
            sut
                .WaitWhilePaused()
                .Subscribe(_ => executed = true);

            Assert.False(executed);

            sut.IsPaused = false;

            Assert.True(executed);
        }