Esempio n. 1
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));
        }
Esempio n. 2
0
        public void RespondsToHasQueueSurpassedScoreAsFalseWhenIsEqualThanScore()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(10);

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

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.False(queueScore.HasQueueSurpassedScore(queuePosition));
        }
Esempio n. 3
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));
        }
Esempio n. 4
0
        public void RespondsToHasQueueSurpassedScoreAsFalseAddingScoreAsWell()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(30);

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

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.False(queueScore.HasQueueSurpassedScore(queuePosition, 10));
        }
Esempio n. 5
0
        public void RespondsToRefreshScoreAddingWhenThereIsAlreadyScore()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore();

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

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.AreEqual(10, queueScore.GetScore(queuePosition));
        }
Esempio n. 6
0
        public void RespondsToHasQueueEqualsScoreAsFalseWhenMaxScoreIsNotReached()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore(20);

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

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.False(queueScore.HasQueueEqualsScore(queuePosition));
        }
Esempio n. 7
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));
        }
Esempio n. 8
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));
        }