Exemplo n.º 1
0
        public void Empty_Input_Throws_Error()
        {
            //arrange
            int[] input = new int[0];

            //assert
            Assert.Throws <EmptyArrayException>(() =>
            {
                //act
                var actual = InsertSort.InsertionSort(input);
            });
        }
Exemplo n.º 2
0
        public void Testing_Insertion_Sort()
        {
            //arrange
            int[] input    = new int[] { 5, 2, 9, 4 };
            int[] expected = new int[] { 2, 4, 5, 9 };

            //act
            int[] actual = InsertSort.InsertionSort(input);

            //assert
            Assert.Equal(expected, actual);
        }