public void TestSum_RectanglePlusRectangle_Rectangle(
            StaticMatrix <string> firstMatrix, StaticMatrix <string> secondMatrix, StaticMatrix <string> expected)
        {
            var actual = firstMatrix.Sum(secondMatrix);

            CollectionAssert.AreEqual(expected.ToRectangleArray(), actual.ToRectangleArray());
        }
Example #2
0
        public void TestGet_IndexOut_IndexOutOfRangeException()
        {
            var matrix = new StaticMatrix <int>(new int[, ]
            {
                { 1, 2, 3, 4 },
                { 5, 6, 7, 8 }
            });

            Assert.Throws <IndexOutOfRangeException>(() => matrix[1, 4].ToString());
        }
Example #3
0
        public void TestConstructStaticMatrix_MatrixConstructor_Pass()
        {
            var matrix = new StaticMatrix <int>(new int[, ]
            {
                { 1, 2, 3, 4 },
                { 5, 6, 7, 8 }
            });

            new StaticMatrix <int>(matrix);

            Assert.Pass();
        }
Example #4
0
        public void TestGet_Item_Item()
        {
            var matrix = new StaticMatrix <int>(new int[, ]
            {
                { 1, 2, 3, 4 },
                { 5, 6, 7, 8 }
            });
            var expected = 6;

            var actual = matrix[1, 1];

            Assert.AreEqual(expected, actual);
        }