Пример #1
0
        public void IfAnyNumberLessThanNegative9_ThrowException()
        {
            var testData = GetTestData();

            testData[1][1] = -10;

            Assert.Throws <InvalidOperationException>(() => HourGlassSum.GetHighestSum(testData));
        }
Пример #2
0
        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));
        }
Пример #3
0
        public void GetHighestSum_ShouldReturnExpectedResult(int[][] input, int expectedResult)
        {
            var result = HourGlassSum.GetHighestSum(input);

            Assert.AreEqual(expectedResult, result);
        }
Пример #4
0
        public void IfArrayHasExceededRowLimit(int rows)
        {
            var testData = new int[rows][];

            Assert.Throws <InvalidOperationException>(() => HourGlassSum.GetHighestSum(testData));
        }
Пример #5
0
        public void HourGlassSum_Test(HourGlassTestData testData)
        {
            var result = HourGlassSum.hourglassSum(testData.Items);

            Assert.AreEqual(testData.ExpectedResult, result);
        }
Пример #6
0
        public static void TestHourGlassSum()
        {
            HourGlassSum sumManager = new HourGlassSum();

            sumManager.getSum();
        }