Esempio n. 1
0
        public void Test_MatrixTrace_Sum()

        {
            MatrixTrace mt = new MatrixTrace(2, 2);

            double expected = mt.Matrix[0, 0] + mt.Matrix[1, 1];

            mt.Print();

            double result = mt.Sum;

            Assert.Equal(expected, result);
        }
Esempio n. 2
0
        public void Test_MatrixTrace_Sum1()

        {
            MatrixTrace trace = new MatrixTrace(3, 3);

            trace.Matrix = new double[3, 3] {
                { 0, 1, 2 }, { 3, 4, 5 }, { 6, 7, 8 }
            };

            double expected = 12;

            trace.Print();

            double result = trace.Sum;

            Assert.Equal(expected, result);
        }