コード例 #1
0
ファイル: InsertSortTests.cs プロジェクト: bproorda/401-DSA
        public void Empty_Input_Throws_Error()
        {
            //arrange
            int[] input = new int[0];

            //assert
            Assert.Throws <EmptyArrayException>(() =>
            {
                //act
                var actual = InsertSort.InsertionSort(input);
            });
        }
コード例 #2
0
ファイル: InsertSortTests.cs プロジェクト: bproorda/401-DSA
        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);
        }