Ejemplo n.º 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);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
        public void IsOngoing_NTimes_True()
        {
            var strategy = new CountNumericLoopStrategy(10, 3, 2);

            Assert.That(strategy.IsOngoing(), Is.True);
        }
Ejemplo n.º 4
0
        public void IsOngoing_ZeroTimes_False()
        {
            var strategy = new CountNumericLoopStrategy(0, 3, 2);

            Assert.That(strategy.IsOngoing(), Is.False);
        }