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

            var result = SelectionSortFunctions.SelectionSort(testArray);

            Assert.IsNull(result);
        }
예제 #2
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));
        }
예제 #3
0
        public void SelectionSort_ReturnsException_WhenArrayIsNull()
        {
            int[] testArray = null;

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