コード例 #1
0
        public void TestNullArray()
        {
            //Arrange
            int[] array = null;
            //Act
            var output = CopyEvens.Copy(array);

            //Assert
            //Not needed
        }
コード例 #2
0
        public void TestEmptyArray()
        {
            //Arrange
            int[] array = new int[0];

            //Act
            var output = CopyEvens.Copy(array);

            //Assert
            //Not needed
        }
コード例 #3
0
        public void TestOddArray()
        {
            //Arrange
            int[] array          = new int[] { 1, 3, 5, 7, 9 };
            int[] expectedOutput = new int[0];

            //Act
            var output = CopyEvens.Copy(array);

            //Assert
            CollectionAssert.AreEqual(output, expectedOutput);
        }
コード例 #4
0
        public void TestEvensArray()
        {
            //Arrange
            int[] array          = new int[] { 2, 4, 6, 8, 10 };
            int[] expectedOutput = new int[] { 2, 4, 6, 8, 10 };

            //Act
            var output = CopyEvens.Copy(array);

            //Assert
            CollectionAssert.AreEqual(output, expectedOutput);
        }