示例#1
0
        public void SelectionSort_ReturnsNull_WhenArrayIsEmpty()
        {
            int[] testArray = { };

            var result = SelectionSortFunctions.SelectionSort(testArray);

            Assert.IsNull(result);
        }
示例#2
0
        public void FindIndexOfSmallestValue_ReturnsSmallestValueIndex_WhenArrayIsValidAndMixedSigns()
        {
            int[] testArray = { 5, -22, 9, 0, -10 };

            var result = SelectionSortFunctions.FindIndexOfSmallestValue(testArray);

            Assert.AreEqual(1, result);
        }
示例#3
0
        public void FindIndexOfSmallestValue_ReturnsSmallestValueIndex_WhenArrayIsValidAndAllPositive()
        {
            int[] testArray = { 5, 2, 9, 0, 10 };

            var result = SelectionSortFunctions.FindIndexOfSmallestValue(testArray);

            Assert.AreEqual(3, result);
        }
示例#4
0
        public void FindIndexOfSmallestValue_ReturnsNull_WhenArrayIsEmpty()
        {
            int[] testArray = { };

            var result = SelectionSortFunctions.FindIndexOfSmallestValue(testArray);

            Assert.IsNull(result);
        }
示例#5
0
        public void SelectionSort_ReturnsOrderedArray_WhenArrayIsValid()
        {
            int[] testArray      = { 9, -10, 2, -5, 11, 23 };
            int[] expectedResult = { -10, -5, 2, 9, 11, 23 };

            var result = SelectionSortFunctions.SelectionSort(testArray);

            Assert.That(result, Is.EqualTo(expectedResult));
        }
示例#6
0
        public void FindIndexOfSmallestValue_ReturnsException_WhenArrayNull()
        {
            int[] testArray = null;

            Assert.That(() => SelectionSortFunctions.FindIndexOfSmallestValue(testArray), Throws.ArgumentNullException);
        }
示例#7
0
        public void SelectionSort_ReturnsException_WhenArrayIsNull()
        {
            int[] testArray = null;

            Assert.That(() => SelectionSortFunctions.SelectionSort(testArray), Throws.ArgumentNullException);
        }