예제 #1
0
        public void RespondsToUpdateMaxScoreChangingTheMaxScore()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(10);

            queueScore.RefreshScore(queuePosition, 5);
            queueScore.RefreshScore(queuePosition, 5);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.True(queueScore.HasQueueReachedScore(queuePosition));

            queueScore.UpdateMaxScore(30);
            Assert.False(queueScore.HasQueueReachedScore(queuePosition));
        }
예제 #2
0
        public void RespondsToResetScoreSettingTheScoreAs0WhenDefault()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(10);

            queueScore.RefreshScore(queuePosition, 5);
            queueScore.RefreshScore(queuePosition, 5);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.True(queueScore.HasQueueReachedScore(queuePosition, 10));

            queueScore.UpdateMaxScore(0);
            queueScore.ResetScore(queuePosition);
            Assert.True(queueScore.HasQueueReachedScore(queuePosition));
        }
예제 #3
0
        public void RespondsToResetScoreSettingTheScoreEvenWhenThereIsNoScoreAtPosition()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            queueScore.ResetScore(queuePosition, 20);
            Assert.True(queueScore.HasQueueReachedScore(queuePosition));
        }
예제 #4
0
        public void RespondsToHasQueueReachedScoreAsTrueWhenMaxScoreIsSurpassed()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(5);

            queueScore.RefreshScore(queuePosition, 5);
            queueScore.RefreshScore(queuePosition, 5);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.True(queueScore.HasQueueReachedScore(queuePosition));
        }
예제 #5
0
        public void RespondsToHasQueueReachedScoreAsTrueWhenMaxScoreIsReachedPuttingAdditionalScore()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(30);

            queueScore.RefreshScore(queuePosition, 5);
            queueScore.RefreshScore(queuePosition, 5);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.True(queueScore.HasQueueReachedScore(queuePosition, 20));
        }