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 FromJumpSolutionTest() { var frog = new FrogJump(); int result = frog.Solve(10, 85, 30); Assert.AreEqual(3, result); }
public void FrogJump_Should_Process_Max_Values() { FrogJump subject = new FrogJump(); int result = subject.solution(1, 10000000, 1); Assert.Equal(9999999, result); }
public void FrogJump_Should_Process_Simple_Values() { FrogJump subject = new FrogJump(); int result = subject.solution(10, 85, 30); Assert.Equal(3, result); }
public void Setup() { _binaryGap = new BinaryGap(); _arrayRotation = new ArrayRotation(); _unpairedElements = new UnpairedElements(); _frogJump = new FrogJump(); _permMissingElement = new PermMissingElement(); _tapeEquilibrium = new TapeEquilibrium(); _frogRiverOne = new FrogRiverOne(); _maxCounters = new MaxCounters(); _missingInteger = new MissingInteger(); }
public void FrogJumpTest2() { //Arrange int X = 5; int Y = 1000000000; int D = 2; int expected = 499999998; int actual = 0; //Act actual = FrogJump.solution2(X, Y, D); //Assert Assert.Equal(expected, actual); }
public void FrogJumpTest1() { //Arrange int X = 10; int Y = 85; int D = 30; int expected = 3; int actual = 0; //Act actual = FrogJump.solution2(X, Y, D); //Assert Assert.Equal(expected, actual); }
public void Test() { FrogJump jump = new FrogJump(); int count = jump.solution(10, 85, 30); Assert.AreEqual(3, count); count = jump.solution(1, 5, 2); Assert.AreEqual(2, count); count = jump.solution(5, 5, 2); Assert.AreEqual(0, count); }
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 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)); }