Пример #1
0
        public void QueueListLengthsAreEqual_InEqualLengths_ReturnsFalse()
        {
            ArrayCompare.ClearAlgorithmQueue();

            ArrayCompare.algorithmNames.Add("Test");

            Assert.IsFalse(ArrayCompare.QueueListLengthsAreEqual());
        }
Пример #2
0
        public void QueueListLengthsAreEqual_EqualLengths_ReturnsTrue()
        {
            ArrayCompare.ClearAlgorithmQueue();

            ArrayCompare.AddAlgorithmToQueue("Selection Sort", ArraySortingAlgorithms.SelectionSort);
            ArrayCompare.AddAlgorithmToQueue("Bubble Sort", ArraySortingAlgorithms.BubbleSort);

            Assert.IsTrue(ArrayCompare.QueueListLengthsAreEqual());
        }
Пример #3
0
        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());
        }
Пример #4
0
        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());
        }
Пример #5
0
        public void QueueListLengthsAreEqual_EmptyLists_ReturnsTrue()
        {
            ArrayCompare.ClearAlgorithmQueue();

            Assert.IsTrue(ArrayCompare.QueueListLengthsAreEqual());
        }