Ejemplo n.º 1
0
        public void Can_reverse_empty_array()
        {
            // Arrange
            int[] input = new int[0];

            // Act
            int[] result = ArrayChallenges.ArrayReverse(input);

            // Assert
            Assert.Empty(result);

            // Not in-place reversal
            Assert.NotSame(input, result);
        }
Ejemplo n.º 2
0
        public void Can_reverse_array_of_numbers(int[] input, int[] expected)
        {
            // Arrange
            // from input

            // Act
            int[] result = ArrayChallenges.ArrayReverse(input);

            // Assert
            Assert.Equal(expected, result);

            // Not in-place reversal
            Assert.NotSame(input, result);
        }