Accord.Tests.Math.MatrixFormatTest.StringFormat2 C# (CSharp) Method

StringFormat2() private method

private StringFormat2 ( ) : void
return void
        public void StringFormat2()
        {
            double[][] matrix = 
            {
                new double[] { 1, 2 },
                new double[] { 3, 4 },
            };

            string expected, actual;


            expected = "[1.00 2.00; 3.00 4.00]";
            actual = String.Format(OctaveMatrixFormatProvider.InvariantCulture, "{0:Ms,N2}", matrix as Array);
            Assert.AreEqual(expected, actual);

            expected = "1.00 2.00 3.00 4.00";
            actual = String.Format(DefaultMatrixFormatProvider.InvariantCulture, "{0:Ms,N2}", matrix as Array);
            Assert.AreEqual(expected, actual);

            expected = "new double[][] { new double[] { 1.00, 2.00 }, new double[] { 3.00, 4.00 } };";
            actual = String.Format(CSharpJaggedMatrixFormatProvider.InvariantCulture, "{0:Ms,N2}", matrix as Array);
            Assert.AreEqual(expected, actual);

            expected = "new double[,] { { 1.00, 2.00 }, { 3.00, 4.00 } };";
            actual = String.Format(CSharpMatrixFormatProvider.InvariantCulture, "{0:Ms,N2}", matrix as Array);
            Assert.AreEqual(expected, actual);

        }