public void EqualityTestString(string[,] elements)
        {
            var lhs = new SquareMatrix <string>(elements);
            var rhs = new SquareMatrix <string>(elements);

            Assert.IsTrue(lhs.Equals(rhs));
        }
        public void EqualityTestInt(int[,] elements)
        {
            var lhs = new SquareMatrix <int>(elements);
            var rhs = new SquareMatrix <int>(elements);

            Assert.IsTrue(lhs.Equals(rhs));
        }
예제 #3
0
        public void TestMatrixAddSqXSq(double[,] array1, double[,] array2, double[,] arrayres)
        {
            SquareMatrix <double> matr1   = new SquareMatrix <double>(array1);
            SquareMatrix <double> matr2   = new SquareMatrix <double>(array2);
            SquareMatrix <double> matrres = new SquareMatrix <double>(arrayres);

            matr1.MatrixAdd(matr2);
            Assert.That(matr1.Equals(matrres));
        }
        public void Equals_MatrixEqulasMatrix_FalseReturned()
        {
            var a = new SquareMatrix<int>(new int[,]{
                {1,2},
                {1,2}});
            var b = new SquareMatrix<int>(new int[,]{
                {1,3},
                {1,2}});


            bool result = a.Equals(b);


            Assert.AreEqual(false, result);
        }
 public void CreatingSquareMatrix()
 {
     Matrix<int> m = new SquareMatrix<int>(new int[2][] { new int[2] { 1, 2 }, new int[2] { 2, 3 } });
     Matrix<int> m1 = new SquareMatrix<int>(new int[2][] { new int[2] { 1, 2 }, new int[2] { 2, 3 } });
     Assert.IsTrue(m.Equals( m1));
 }