Пример #1
0
        public void SwapRowsTest()
        {
            //matrix property needs to be set to public for this
            double[,] m = { { 1, 7, 9 }, { 6, 4, 3 }, { 0, 5, 8 } };
            ChemEqnMatrix cm = new ChemEqnMatrix(m);

            double[,] expected = { { 0, 5, 8 }, { 6, 4, 3 }, { 1, 7, 9 } };
            cm.SwapRows(0, 2);
            for (int i = 0; i < m.GetLength(0); i++)
            {
                for (int j = 0; j < m.GetLength(1); j++)
                {
                    Assert.AreEqual(expected[i, j], cm.matrix[i, j]);
                }
            }
        }