public void Mega_Multiple_Coding_Loops_Tests(int[] array, int expected) { //arrange // act var actual = Eng35Tests.Mega_Multiple_Coding_Loops(array); // assert Assert.AreEqual(expected, actual); }
public void Mega_Multiple_Coding_Loops(int[] myarray, int expected) { var actual = Eng35Tests.Mega_Multiple_Coding_Loops(myarray); Assert.AreEqual(expected, actual); /*Pass in array of 10 numbers[10, 11, 15, 25..While loop ==> add one to each number[11, 12, 16 * * Do..While loop ==> add 3 to each number[14, 15, 19..Foreach loop ==> double each number[28, 30, 38... * Create a Cat class with string Name and int Age.Have a Constructor. * * Create a list of Cats and foreach loop => create new cat with name 'Cat'+number' and Age=number * eg first cat is called 'Cat28' and has Age 28. * print the list of cats with names and ages * Return the total of all the ages of all cats!*/ }
static void Main(string[] args) { // Eng35Tests.Create_Array_From_Sentence("This is a test"); // Eng35Tests.Calculate_Words_In_Sentence("This is another test"); // Eng35Tests.Turns_First_Word_To_Uppercase(); // Eng35Tests.Turns_All_Words_To_Uppercase_But_Last_Word_To_Lowercase(); int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; Eng35Tests.Mega_Multiple_Coding_Loops(array); /* for (int i = 1; i <= 100; i++) * { * if (i % 3 == 0) * { * Console.Write("Fizz"); * } * if (i % 5 == 0) * { * Console.Write("Buzz"); * } * }*/ }
static void Main(string[] args) { int[] ar = new int[] { 1, 2, 3, 5, 6, 7, 8, 9, 10, 11 }; int[] tr = new int[] { 10, 20, 30, 50, 60, 70, 80, 90, 100, 110 }; //return array int[] ra = new int[] { 1, 2, 3, 4, 5, 6 }; //xyz int[] xyz = new int[] { 94, 101, 20, 45, 57 }; var numArray = new int[] { 10, 20, 30, 40 }; var snaptest = new int[] { 5, 6, 7, 8, 9 }; int[] rabbits01 = new int[] { }; //Console.WriteLine("Hello World!"); //Console.WriteLine(Eng35Tests.CreateArrayFromSentence(" ")); Eng35Tests.Mega_Multiple_Coding_Loops(ar); Eng35Tests.Mega_Loops_TrialRun(tr); //xyz Eng35Tests.Accept_Xyz(xyz); //Console.WriteLine(Eng35Tests.Accept_Xyz(xyz)); Eng35Tests.Array_loop_queue_stack(numArray); //How_Many_Numbers_Divisible_by Eng35Tests.How_Many_Numbers_Divisible_by(2, 10, 4); Console.WriteLine(Eng35Tests.How_Many_Numbers_Divisible_by(2, 10, 4)); //return sum Console.WriteLine(Eng35Tests.Return_Sum_of_array(ra)); //method to accept x,y,n //snap test Eng35Tests.snapTest(snaptest); }
public void Mega_Multiple_Coding_Loops(int[] myArray, int expected) { var actual = Eng35Tests.Mega_Multiple_Coding_Loops(myArray); Assert.AreEqual(expected, actual); }