상속: MonoBehaviour
예제 #1
0
        public void Make0AndParamsNullTest()
        {
            // Arrange
            int[] addArray = null;

            // Act
            var array = ArrayMaker.Make(addArray);

            // Assert
            Assert.IsNull(array);
        }
예제 #2
0
        public void Add4Test()
        {
            // Arrange
            var expected = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            var array    = new[] { 0, 1, 2, 3, 4, 5 };

            // Act
            ArrayMaker.Add(ref array, 6, 7, 8, 9);

            // Assert
            CollectionAssert.AreEqual(expected, array);
        }
예제 #3
0
        public void Make5AndParamsTest()
        {
            // Arrange
            var expected = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            var addArray = new[] { 5, 6, 7, 8, 9, 10, 11, 12 };

            // Act
            var array = ArrayMaker.Make(0, 1, 2, 3, 4, addArray);

            // Assert
            CollectionAssert.AreEqual(expected, array);
        }
예제 #4
0
        public void Make5AndParamssNullTest()
        {
            // Arrange
            var expected = new int[] { 0, 1, 2, 3, 4 };

            int[] addArray = null;

            // Act
            var array = ArrayMaker.Make(0, 1, 2, 3, 4, addArray);

            // Assert
            CollectionAssert.AreEqual(expected, array);
        }
예제 #5
0
        public void Add5AndParamsTest()
        {
            // Arrange
            var expected = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            var addArray = new[] { 10, 11, 12 };
            var array    = new[] { 0, 1, 2, 3, 4 };

            // Act
            ArrayMaker.Add(ref array, 5, 6, 7, 8, 9, addArray);

            // Assert
            CollectionAssert.AreEqual(expected, array);
        }
예제 #6
0
        static void Main(string[] args)
        {
            ArrayMaker maker = new ArrayMaker();

            //ArrayReverse reverse = new ArrayReverse();

            Console.WriteLine("Welcome to HW_05_Task_03 main menu\n\tPlease enter array length");
            int[] srcArray = maker.RandomArrayMaker(Convert.ToInt32(Console.ReadLine()));
            Console.WriteLine("The source array is:\n" + maker.ShowArray(srcArray) + "\nPress any key to reverse the source array");
            Console.ReadKey();
            Console.WriteLine("The reversed array in:\n" + maker.ShowArray(ArrayReverse.ReverseArray(srcArray)));
            Array.Reverse(srcArray);
        }
예제 #7
0
        public void Add4AndParamssNullTest()
        {
            // Arrange
            var expected = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            var array    = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 };

            int[] addArray = null;

            // Act
            ArrayMaker.Add(ref array, 9, 10, 11, 12, addArray);

            // Assert
            CollectionAssert.AreEqual(expected, array);
        }
예제 #8
0
    void OnAllCollidersCreated()
    {
        int        curMIDINote = midiStartNote;
        ArrayMaker arrayMaker  = transform.GetComponent <ArrayMaker>();

        for (int xNum = 0; xNum < arrayMaker.numXElements; xNum++)
        {
            for (int yNum = 0; yNum < arrayMaker.numYElements; yNum++)
            {
                for (int zNum = 0; zNum < arrayMaker.numZElements; zNum++)
                {
                    arrayMaker.Colliders[xNum, yNum, zNum].GetComponent <MIDITrigger>().midiNote = curMIDINote++;
                }
            }
        }
    }
예제 #9
0
        static void Main(string[] args)
        {
            ArrayModifier modifier = new ArrayModifier();
            ArrayMaker    printer  = new ArrayMaker();

            int[] array;
            int   insertingPosition;
            int   insertingValue;

            Console.WriteLine("Hello! Welcome to HW_06_Task_02 main menu\n\tPlease enter the array values");
            array = modifier.ArrayCreation(new Random().Next(5, 15));
            Console.WriteLine(printer.ShowArray(array));
            Console.WriteLine("Please enter position of inserting element");
            Int32.TryParse(Console.ReadLine(), out insertingPosition);
            Console.WriteLine("\nPlease enter inserting element value");
            Int32.TryParse(Console.ReadLine(), out insertingValue);
            Console.WriteLine("The modified array is: " + printer.ShowArray(modifier.ModifyArray(array, insertingPosition, insertingValue)));
        }