コード例 #1
0
        public void NewElement_IncorrectParams_TrowsExeption()
        {
            int[,] arr1 = { { 1, 2 }, { 2, 4 } };
            SymmetricMatrix <int> m1 = new SymmetricMatrix <int>(arr1);

            m1.NewElement(10, 10, 88);
        }
コード例 #2
0
        public void CreatingMatrix_IndexatorWork_ChangingElement_CorrectParams_ExpectedResult()
        {
            int[,] arr = { { 1, 2 }, { 2, 4 } };
            SymmetricMatrix <int> s = new SymmetricMatrix <int>(arr);

            s.NewElement(1, 1, 10);

            int expected = 10;

            int actual = s[1, 1];

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void EventWork_CorrectParams_ExpectedResult()
        {
            int[,] arr1 = { { 1, 2 }, { 2, 4 } };
            SymmetricMatrix <int> m1 = new SymmetricMatrix <int>(arr1);

            m1.MatrixElementChanged += TestMethod;

            bool expected = true;

            m1.NewElement(1, 1, 10);
            bool actual = test;

            Assert.AreEqual(expected, actual);
        }