예제 #1
0
        public void IsOngoing_OneTimes_TrueThenFalse()
        {
            var strategy = new CountNumericLoopStrategy(1, 3, 2);

            Assert.That(strategy.IsOngoing(), Is.True);
            strategy.GetNext();
            Assert.That(strategy.IsOngoing(), Is.False);
        }
예제 #2
0
        public void Run_parameters_CorrectResult(int count, decimal seed, decimal step, decimal expected)
        {
            var strategy = new CountNumericLoopStrategy(count, seed, step);
            var final    = 0m;

            while (strategy.IsOngoing())
            {
                final = strategy.GetNext();
            }
            Assert.That(final, Is.EqualTo(expected));
        }
예제 #3
0
        public void GetNext_FirstTime_Seed()
        {
            var strategy = new CountNumericLoopStrategy(10, 4, 1);

            Assert.That(strategy.GetNext(), Is.EqualTo(4));
        }