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()); }