public void FindNextBiggerNumber_ReturnNumberIsBiggerThanHighestInteger_MinusOneReturned(int initialNumber) { int actual = NumericUtils.FindNextBiggerNumber(initialNumber); int expected = -1; Assert.AreEqual(expected, actual); }
public void FindNextBiggerNumber_CorrectNumberPassed_ExecutionTimeIsApproximatelyCorrect(int initialNumber) { Stopwatch sw = new Stopwatch(); sw.Start(); NumericUtils.FindNextBiggerNumber(initialNumber, out long actualMilliseconds); sw.Stop(); Assert.That(sw.ElapsedMilliseconds, Is.InRange(actualMilliseconds, actualMilliseconds + 1)); }
public void FindNextBiggerNumber_NonPositiveNumberPassed_ArgumentOutOfRangeExceptionThrown(int initialNumber) { Assert.Throws <ArgumentOutOfRangeException>(() => NumericUtils.FindNextBiggerNumber(initialNumber)); }
public void FindNextBiggerNumber_CorrectNumberPassed_WorksCorrectly(int initialNumber, int expected) { int actual = NumericUtils.FindNextBiggerNumber(initialNumber); Assert.AreEqual(expected, actual); }