public static void Test() { var X = 4; var A = new int[] { 1, 2, 3, 4, 2, 3 }; var R = new FrogRiverOne().Solution(X, A); Console.WriteLine("Result: " + R); X = 4; A = new int[] { 1, 4, 1, 2, 3, 4, 2, 3 }; R = new FrogRiverOne().Solution(X, A); Console.WriteLine("Result: " + R); X = 4; A = new int[] { 1, 2, 1, 2, 3, 3, 2, 3 }; R = new FrogRiverOne().Solution(X, A); Console.WriteLine("Result: " + R); var N = new Random().Next(1, 100000); X = new Random().Next(1, 100000); A = CreateArray(N, 1, X); TestBuddy.PrintArray(A); Console.WriteLine("X: " + X); R = new FrogRiverOne().Solution(X, A); Console.WriteLine("result: " + R); var E = new FrogRiverOne().Check(X, A); Console.WriteLine("expected: " + E); }
public static void Test() { var missingInteger = new MissingInteger(); int[] A = new int[] { 1, 3, 6, 4, 1, 2 }; int result = missingInteger.Solution(A); TestBuddy.PrintTestResult(5, result); A = new int[] { 3, 6, 4, 1, 2, 5, 7 }; result = missingInteger.Solution(A); TestBuddy.PrintTestResult(8, result); A = new int[] { 3, 6, 4, 1000, 2, -2, 0 }; result = missingInteger.Solution(A); TestBuddy.PrintTestResult(1, result); }