public void RunTestbench_NoAlgorithms_DoesntReturnError() { ArrayCompare.ClearAlgorithmQueue(); ArrayCompare.RunTestbench(); //If there is no error, this test is a success }
public void QueueListLengthsAreEqual_InEqualLengths_ReturnsFalse() { ArrayCompare.ClearAlgorithmQueue(); ArrayCompare.algorithmNames.Add("Test"); Assert.IsFalse(ArrayCompare.QueueListLengthsAreEqual()); }
public void QueueListLengthsAreEqual_EqualLengths_ReturnsTrue() { ArrayCompare.ClearAlgorithmQueue(); ArrayCompare.AddAlgorithmToQueue("Selection Sort", ArraySortingAlgorithms.SelectionSort); ArrayCompare.AddAlgorithmToQueue("Bubble Sort", ArraySortingAlgorithms.BubbleSort); Assert.IsTrue(ArrayCompare.QueueListLengthsAreEqual()); }
public void GetAlgorithmIndex_ValidIndex_ReturnsRightIndexOne() { int expectedResult = 1; ArrayCompare.ClearAlgorithmQueue(); ArrayCompare.AddAlgorithmToQueue("Selection Sort", ArraySortingAlgorithms.SelectionSort); ArrayCompare.AddAlgorithmToQueue("Bubble Sort", ArraySortingAlgorithms.BubbleSort); int result = ArrayCompare.GetAlgorithmIndex("Bubble Sort"); Assert.AreEqual(expectedResult, result); }
public void AddAlgorithmToQueue_NewAlgorithm_DoesAddToQueue() { int expectedResult = 1; ArrayCompare.ClearAlgorithmQueue(); ArrayCompare.AddAlgorithmToQueue("Bubble Sort", ArraySortingAlgorithms.BubbleSort); Assert.IsTrue(ArrayCompare.algorithmNames.Contains("Bubble Sort")); Assert.AreEqual(expectedResult, ArrayCompare.algorithmNames.Count); Assert.IsTrue(ArrayCompare.QueueListLengthsAreEqual()); }
public void ClearAlgorithmQueue_ClearsQueue() { int expectedResult = 0; ArrayCompare.ClearAlgorithmQueue(); ArrayCompare.AddAlgorithmToQueue("Selection Sort", ArraySortingAlgorithms.SelectionSort); ArrayCompare.AddAlgorithmToQueue("Bubble Sort", ArraySortingAlgorithms.BubbleSort); ArrayCompare.ClearAlgorithmQueue(); Assert.AreEqual(expectedResult, ArrayCompare.algorithmNames.Count); Assert.IsTrue(ArrayCompare.QueueListLengthsAreEqual()); }
public void QueueListLengthsAreEqual_EmptyLists_ReturnsTrue() { ArrayCompare.ClearAlgorithmQueue(); Assert.IsTrue(ArrayCompare.QueueListLengthsAreEqual()); }