예제 #1
0
        public void Should_not_have_IsScheduled_set()
        {
            //arrange
            var scheduledSet = new ScheduledValue <bool>(false);

            //act


            //assert
            Assert.False(scheduledSet.IsScheduled);
            Assert.False(scheduledSet.WasSet);
        }
예제 #2
0
        public void Should_not_have_IsScheduled_set()
        {
            //arrange
            var scheduledSet = new ScheduledValue<bool>(false);

            //act


            //assert
            Assert.False(scheduledSet.IsScheduled);
            Assert.False(scheduledSet.WasSet);
        }
예제 #3
0
        public void Should_cancel_scheduled_set()
        {
            //arrange
            var scheduledSet = new ScheduledValue <int>(0);

            //act
            scheduledSet.Schedule(12, TimeSpan.FromSeconds(1));
            Assert.True(scheduledSet.IsScheduled);
            scheduledSet.Cancel();

            //assert
            Assert.False(scheduledSet.IsScheduled);
            Assert.False(scheduledSet.WasSet);
        }
예제 #4
0
        public void Should_cancel_scheduled_set()
        {
            //arrange
            var scheduledSet = new ScheduledValue<int>(0);

            //act
            scheduledSet.Schedule(12, TimeSpan.FromSeconds(1));
            Assert.True(scheduledSet.IsScheduled);
            scheduledSet.Cancel();

            //assert
            Assert.False(scheduledSet.IsScheduled);
            Assert.False(scheduledSet.WasSet);
        }
예제 #5
0
        public void Should_schedule_future_set()
        {
            //arrange
            var scheduledSet = new ScheduledValue <int>(0);

            //act
            scheduledSet.Schedule(12, TimeSpan.FromSeconds(1));
            Assert.True(scheduledSet.IsScheduled);
            Thread.Sleep(TimeSpan.FromSeconds(2));

            //assert
            Assert.Equal(12, scheduledSet.Value);
            Assert.True(scheduledSet.WasSet);
            Assert.False(scheduledSet.IsScheduled);
        }
예제 #6
0
        public void Should_schedule_future_set()
        {
            //arrange
            var scheduledSet = new ScheduledValue<int>(0);

            //act
            scheduledSet.Schedule(12, TimeSpan.FromSeconds(1));
            Assert.True(scheduledSet.IsScheduled);
            Thread.Sleep(TimeSpan.FromSeconds(2));

            //assert
            Assert.Equal(12, scheduledSet.Value);
            Assert.True(scheduledSet.WasSet);
            Assert.False(scheduledSet.IsScheduled);
        }
예제 #7
0
 public BasicExecutor()
 {
     AcceptingJobsDeadline = new ScheduledValue<bool>(true);
 }
예제 #8
0
 public BasicExecutor()
 {
     AcceptingJobsDeadline = new ScheduledValue <bool>(true);
 }