public void Tests(int x, int y, int d, int expected) { FrogJump jump = new FrogJump(); var result = jump.Solution(x, y, d); Assert.AreEqual(expected, result); }
public void XSmallerThenYTest() { bool catchException = false; try { FrogJump.Solution(15, 4, 5); } catch (ArgumentException) { catchException = true; } if (catchException) { Assert.Pass(); } else { Assert.Fail(); } }
public void TestFrogJump() { int s = _frogJump.Solution(10, 85, 30); Assert.AreEqual(3, s); }
public void NumberOutOfRangeTest() { int catchException = 0; try { FrogJump.Solution(int.MaxValue, 5, 5); } catch (ArgumentOutOfRangeException) { catchException++; } try { FrogJump.Solution(5, int.MaxValue, 5); } catch (ArgumentOutOfRangeException) { catchException++; } try { FrogJump.Solution(5, 5, int.MaxValue); } catch (ArgumentOutOfRangeException) { catchException++; } try { FrogJump.Solution(0, 5, 5); } catch (ArgumentOutOfRangeException) { catchException++; } try { FrogJump.Solution(5, 0, 5); } catch (ArgumentOutOfRangeException) { catchException++; } try { FrogJump.Solution(0, 0, 0); } catch (ArgumentOutOfRangeException) { catchException++; } try { FrogJump.Solution(5, 5, 0); } catch (ArgumentOutOfRangeException) { catchException++; } if (catchException == 7) { Assert.Pass(); } else { Assert.Fail(); } }
public void ZeroJumpTest() { Assert.AreEqual(0, FrogJump.Solution(30, 30, 10)); }
public void OneJumpTest() { Assert.AreEqual(1, FrogJump.Solution(30, 60, 80)); }
public void WitheZeroStartTest() { Assert.AreEqual(128, FrogJump.Solution(1, 256, 2)); }
public void ExactlyOnPostionTest() { Assert.AreEqual(2, FrogJump.Solution(20, 50, 15)); }
public void ExampleTest() { Assert.AreEqual(3, FrogJump.Solution(10, 85, 30)); }