public void ClearArrayQueue_ClearsQueue() { ArrayCompare.ClearArrayQueue(); int[] testArray = ArrayCompare.CreateArray_InOrder(); ArrayCompare.AddToBaseArrays(testArray); ArrayCompare.ClearArrayQueue(); Assert.AreEqual(0, ArrayCompare.baseArrays.Count); Assert.AreEqual(ArrayCompare.sortedArrays.Count, ArrayCompare.baseArrays.Count); }
public void AddToBaseArrays_InvalidArrayLength_DoesNotAddToBaseArray() { int expectedResult = 0; int a = 10; if (a == ArrayCompare.arraySize) { a++; } int[] testArray = new int[a]; ArrayCompare.ClearArrayQueue(); ArrayCompare.AddToBaseArrays(testArray); Assert.AreEqual(expectedResult, ArrayCompare.baseArrays.Count); }
public void AddToBaseArrays_ValidArrayLength_DoesAddToBaseArray() { int expectedResult; ArrayCompare.ClearArrayQueue(); int[] testArray = ArrayCompare.CreateArray_InOrder(); ArrayCompare.AddToBaseArrays(testArray); Assert.IsNotNull(ArrayCompare.baseArrays[0]); Assert.AreEqual(ArrayCompare.baseArrays.Count, 1); for (int i = 0; i < testArray.Length; i++) { expectedResult = testArray[i]; Assert.AreEqual(expectedResult, ArrayCompare.baseArrays[0][i]); } }
public void ResetSortedArrays_ResetsSortedToBaseValues() { int[] testArray; int expectedResult; ArrayCompare.ClearArrayQueue(); testArray = ArrayCompare.CreateArray_InOrder(); ArrayCompare.AddToBaseArrays(testArray); ArrayCompare.ResetSortedArrays(); Assert.AreEqual(ArrayCompare.baseArrays[0].Length, ArrayCompare.sortedArrays[0].Length); for (int i = 0; i < ArrayCompare.baseArrays[0].Length; i++) { expectedResult = ArrayCompare.baseArrays[0][i]; Assert.AreEqual(expectedResult, ArrayCompare.sortedArrays[0][i]); } }