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); }
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)); }
public void GetNext_FirstTime_Seed() { var strategy = new CountNumericLoopStrategy(10, 4, 1); Assert.That(strategy.GetNext(), Is.EqualTo(4)); }