static int Main(string[] args) { int[] unsortedArray = new int[10] { 100, 2, 3, 200, 4, 1, 101, 102, 201, 5 }; int count = unsortedArray.Count <int>(); ConsecutiveArrayProcessor cap = new ConsecutiveArrayProcessor(); int len = cap.getTheLongestConsecutiveLength(unsortedArray); return(0); }
public void getTheLongestConsecutiveLength(int expected, string input) { // arrange string[] strArray = input.Split(','); int[] unsortedArray = new int[strArray.Length]; for (int i = 0; i < strArray.Length; i++) { unsortedArray[i] = Convert.ToInt32(strArray[i]); } int count = unsortedArray.Count <int>(); var cap = new ConsecutiveArrayProcessor(); // act int actual = cap.getTheLongestConsecutiveLength(unsortedArray); // assert Assert.AreEqual(expected, actual); }