public void Make0AndParamsNullTest() { // Arrange int[] addArray = null; // Act var array = ArrayMaker.Make(addArray); // Assert Assert.IsNull(array); }
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); }
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); }
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); }
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); }
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); }
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); }
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++; } } } }
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))); }