示例#1
0
        public static void Shift_Array_add_num_in_middle_of_array()
        {
            int[] arrayToShift = new[] { 1, 2, 3, 4 };
            int   numToInsert  = 6;

            int[] result = ArrayShift.insertShiftArray(arrayToShift, numToInsert);

            Assert.Equal(new int[] { 1, 2, 6, 3, 4 }, result);
        }
        public void Can_shift_array(int value, int[] input, int[] expected)
        {
            // Arrange
            // from data

            // Act
            int[] result = ArrayShift.insertShiftArray(input, value);

            // Assert
            Assert.Equal(expected, result);
        }
 public void TestShift(int[] arr, int num, int[] shiftedArray)
 {
     int[] result = ArrayShift.ShiftArray(arr, num);
     Assert.Equal(result, shiftedArray);
 }
示例#4
0
 public ArrayShiftTest()
 {
     _as = new ArrayShift();
 }