public void IfAnyNumberLessThanNegative9_ThrowException() { var testData = GetTestData(); testData[1][1] = -10; Assert.Throws <InvalidOperationException>(() => HourGlassSum.GetHighestSum(testData)); }
public void IfArrayHasAnyColumnExceededColumnLimit(int cols) { var testData = new int[6][]; for (var i = 0; i < testData.Length; i++) { testData[i] = Enumerable.Range(1, cols).ToArray(); } Assert.Throws <InvalidOperationException>(() => HourGlassSum.GetHighestSum(testData)); }
public void GetHighestSum_ShouldReturnExpectedResult(int[][] input, int expectedResult) { var result = HourGlassSum.GetHighestSum(input); Assert.AreEqual(expectedResult, result); }
public void IfArrayHasExceededRowLimit(int rows) { var testData = new int[rows][]; Assert.Throws <InvalidOperationException>(() => HourGlassSum.GetHighestSum(testData)); }
public void HourGlassSum_Test(HourGlassTestData testData) { var result = HourGlassSum.hourglassSum(testData.Items); Assert.AreEqual(testData.ExpectedResult, result); }
public static void TestHourGlassSum() { HourGlassSum sumManager = new HourGlassSum(); sumManager.getSum(); }