Beispiel #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));
        }
Beispiel #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));
        }