public void MiniMaxSumTests() { // Case One (Correct) var inputCaseOne = new uint[5] { 769082435, 210437958, 673982045, 375809214, 380564127 }; var exercise = new MiniMaxSum(inputCaseOne); var expectedOutputCaseOne = new uint[2] { 1640793344, 2199437821 }; var resultCaseOne = exercise.Execute(); CollectionAssert.AreEqual(expectedOutputCaseOne, resultCaseOne); // Case Two (Check Constraints) - Input Size var inputCaseTwo = new uint[2] { 1, 2 }; Assert.ThrowsException <ConstraintException>( () => new MiniMaxSum(inputCaseTwo)); }
public void SumTest() { var array = new int[] { 1, 2, 3, 4, 5 }; var result = MiniMaxSum.Sum(array); Assert.AreEqual("10 14", result); }
public void TestCase0() { int[] array1 = { 1, 2, 3, 4, 5 }; long[] expected = { 10, 14 }; long[] result = MiniMaxSum.miniMaxSum(array1); CollectionAssert.AreEqual(expected, result); }
public void TestCase2() { int[] array1 = { 396285104, 573261094, 759641832, 819230764, 364801279 }; long[] expected = { 2093989309, 2548418794 }; long[] result = MiniMaxSum.miniMaxSum(array1); CollectionAssert.AreEqual(expected, result); }
public void TestCase1() { int[] array1 = { 256741038, 623958417, 467905213, 714532089, 938071625 }; long[] expected = { 2063136757, 2744467344 }; long[] result = MiniMaxSum.miniMaxSum(array1); CollectionAssert.AreEqual(expected, result); }
static void Main(string[] args) { //================================================================// //================================================================// //WarmUP MODULE // //================================================================// //================================================================// #region [===== WarmUP MODULE =====] //Console.WriteLine("================ TEST 01 ==============="); //var test01 = new SolveMeFirst(); //test01.Start(); Console.WriteLine("================ TEST 02 ==============="); var test02 = new SimpleArraySum(); test02.Start(); Console.WriteLine("================ TEST 03 ==============="); var test03 = new CompareTheTriplets(); test03.Start(); Console.WriteLine("================ TEST 04 ==============="); var test04 = new AVeryBigSum(); test04.Start(); Console.WriteLine("================ TEST 05 ==============="); var test05 = new DiagonalDifference(); test05.Start(); Console.WriteLine("================ TEST 06 ==============="); var test06 = new PlusMinus(); test06.Start(); Console.WriteLine("================ TEST 07 ==============="); var test07 = new MiniMaxSum(); test07.Start(); Console.WriteLine("================ TEST 08 ==============="); var test08 = new Staircase(); test08.Start(); Console.WriteLine("================ TEST 09 ==============="); var test09 = new BirthdayCakeCandles(); test09.Start(); Console.WriteLine("================ TEST 10 ==============="); var test10 = new TimeConversion(); test10.Start(); Console.WriteLine("================ TEST 11 ==============="); #endregion }
public void MiniMaxSum_MinResult() { var input = new MiniMaxSum(5, 2, 3, 1, 4); var expectedMin = 10; Assert.AreEqual(expectedMin, input.MinSum()); input = new MiniMaxSum(7, 8, 5, 6, 4, 3, 1, 2); expectedMin = 28; Assert.AreEqual(expectedMin, input.MinSum()); }
public void MiniMaxSum_MaxResult() { var input = new MiniMaxSum(5, 2, 3, 1, 4); var expectedMax = 14; Assert.AreEqual(expectedMax, input.MaxSum()); input = new MiniMaxSum(7, 8, 5, 6, 4, 3, 1, 2); expectedMax = 35; Assert.AreEqual(expectedMax, input.MaxSum()); }
public void TestCase7() { string a = "123"; string b = "456"; int digita = a[a.Length - 1] - '0'; int digitb = b[b.Length - 1] - '0'; int[] arr = new int[] { 942381765, 627450398, 954173620, 583762094, 236817490 }; MiniMaxSum.miniMaxSum(arr); }
public void TestMethod1() { //arrage var expected = new List <int> { -185, 726 }; var input = new List <int> { 12, 12, 35, 567, 78, 234, 33, 1, -12, -344, -222, -78, 78 }; //act var actual = MiniMaxSum.calculateMiniMax(input); //assert Assert.AreEqual(expected, actual); }
public void MinMaxSumShouldBeReturned() { //Arrange List <long> expectedValues = new List <long>() { 2063136757, 2744467344 }; int[] inputValue = new int[] { 256741038, 623958417, 467905213, 714532089, 938071625 }; //Act List <long> actualValues = MiniMaxSum.MiniMaxSumSolution(inputValue); //Assert Assert.AreEqual(expectedValues, actualValues); }
public void MiniMaxSumTest(long[] input, long[] expected) { var result = MiniMaxSum.Run(input); Assert.AreEqual(expected, result); }
public void Initialize() { _miniMaxSum = new MiniMaxSum(); }
public static void Main() { LargestPrimeFactor largestPrimeFactor = new LargestPrimeFactor(); //largestPrimeFactor.lar //MultiDimentionalArray multiDimentionalArray = new MultiDimentionalArray(); //multiDimentionalArray.Array2D(); //JaggedArrays jaggedArrays = new JaggedArrays(); //jaggedArrays.JaggedArrayExample2D(); MatrixInSpiralOrder matrixInSpiralOrder = new MatrixInSpiralOrder(); matrixInSpiralOrder.PrintMatrixInSprialOrder(); SwitchConsoleStatements(); int[] arr; // Get input selected for class to execute. int.TryParse(Console.ReadLine(), out int n); switch (n) { case 0: Console.WriteLine("Please insert 5 integers with space separated."); // Min max sum arr = ArrayInput(); MiniMaxSum miniMaxSum = new MiniMaxSum(); miniMaxSum.MiniMaxsum(arr); Console.Read(); break; case 1: Console.WriteLine("Please insert age of your niece"); int arCount = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Please insert height of candle with space separated as age."); arr = ArrayInput(); BirthdayCackeCandles birthdayCackeCandles = new BirthdayCackeCandles(); birthdayCackeCandles.BirthdayCakeCandles(arr); Console.Read(); break; case 2: Console.WriteLine("Insert time conversion string ex: 12:05:05PM"); string timeString = Console.ReadLine(); TimeConversion timeConversion = new TimeConversion(); string convertedTime = timeConversion.TimeConversions(timeString); Console.WriteLine(convertedTime); Console.ReadLine(); break; case 3: // Enter details for string interpolatio in future. break; default: Console.WriteLine("Invalid input"); Console.ReadLine(); break; } }