public void TestMethodUpperSection() { // Arrange int[] OnesArray = { 1, 1, 1, 1, 1 }; int[] TwosArray = { 2, 2, 2, 2, 2 }; int[] ThreesArray = { 3, 3, 3, 3, 3 }; int[] FoursArray = { 4, 4, 4, 4, 4 }; int[] FivesArray = { 5, 5, 5, 5, 5 }; int[] SixesArray = { 6, 6, 6, 6, 6 }; // Act int ReturnedOnesSum = SectionCombinations.UpperSection(OnesArray, 1); int ReturnedTwosSum = SectionCombinations.UpperSection(TwosArray, 2); int ReturnedThreesSum = SectionCombinations.UpperSection(ThreesArray, 3); int ReturnedFoursSum = SectionCombinations.UpperSection(FoursArray, 4); int ReturnedFivesSum = SectionCombinations.UpperSection(FivesArray, 5); int ReturnedSixesSum = SectionCombinations.UpperSection(SixesArray, 6); // Assert Assert.AreEqual(ReturnedOnesSum, 5); Assert.AreEqual(ReturnedTwosSum, 10); Assert.AreEqual(ReturnedThreesSum, 15); Assert.AreEqual(ReturnedFoursSum, 20); Assert.AreEqual(ReturnedFivesSum, 25); Assert.AreEqual(ReturnedSixesSum, 30); }
public void TestMethodUpperSectionTheArrayIsNotFiveInLength() { // Arrange int[] OnesArray = { 1, 2, 1, 1 }; // Act int ReturnedOnesSum = SectionCombinations.UpperSection(OnesArray, 1); // Assert Assert.AreEqual(ReturnedOnesSum, 3); }
public void TestMethodUpperSectionNotAllValuesInArrayAreTheSame() { // Arrange int[] OnesArray = { 1, 2, 1, 1, 1 }; // Act int ReturnedOnesSum = SectionCombinations.UpperSection(OnesArray, 1); // Assert Assert.AreEqual(ReturnedOnesSum, 4); }