Exemplo n.º 1
0
        public void RespondsToCompareScoreAsNegative1WhenMaxScoreLesserThanScore()
        {
            var queueScore = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.AreEqual(-1, queueScore.CompareScore(21));
        }
Exemplo n.º 2
0
        public void RespondsToGetScoreAsMinus1WhenThereIsNoScore()
        {
            var queueScore = new SchedulerQueueScore();

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.AreEqual(-1, queueScore.GetScore(0));
        }
Exemplo n.º 3
0
        public void RespondsToCompareScoreAs0WhenItsEqual()
        {
            var queueScore = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.AreEqual(0, queueScore.CompareScore(20));
        }
Exemplo n.º 4
0
        public void RespondsToCompareScoreAs1WhenMaxScoreHigher()
        {
            var queueScore = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.AreEqual(1, queueScore.CompareScore(19));
        }
Exemplo n.º 5
0
        public void RespondsToEqualsScore()
        {
            var queueScore = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.True(queueScore.EqualsScore(20));
        }
Exemplo n.º 6
0
        public void RespondsToEqualsScoreAsFalseWhenMaxScoreIsNotEqual()
        {
            var queueScore = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.False(queueScore.EqualsScore(21));
        }
Exemplo n.º 7
0
        public void RespondsToHasReachedScoreAsFalseWhenMaxScoreIsNotReached()
        {
            var queueScore = new SchedulerQueueScore(20);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.False(queueScore.HasReachedScore(10));
        }
Exemplo n.º 8
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));
        }
Exemplo n.º 9
0
        public void RespondsToGetScoreWhenThereIsScore()
        {
            var queuePosition = 0;
            var queueScore    = new SchedulerQueueScore();

            queueScore.RefreshScore(queuePosition, 5);

            Assert.IsInstanceOf(typeof(SchedulerQueueScore), queueScore);
            Assert.AreEqual(5, queueScore.GetScore(queuePosition));
        }
Exemplo n.º 10
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));
        }
Exemplo n.º 11
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));
        }
Exemplo n.º 12
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));
        }
Exemplo n.º 13
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));
        }
Exemplo n.º 14
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));
        }
Exemplo n.º 15
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));
        }
Exemplo n.º 16
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));
        }