Esempio n. 1
0
        public void Pattern_02()
        {
            const int WIDTH = 25, HEIGHT = 25;

              QRMatrix matrix = new QRMatrix(WIDTH, HEIGHT);
              matrix.Fill(2);
              matrix.AddBasicPatterns(QRVersion.GetVersionByNumber(2));

              string expected =
            "1 1 1 1 1 1 1 0                   0 1 1 1 1 1 1 1\r\n" +
            "1 0 0 0 0 0 1 0                   0 1 0 0 0 0 0 1\r\n" +
            "1 0 1 1 1 0 1 0                   0 1 0 1 1 1 0 1\r\n" +
            "1 0 1 1 1 0 1 0                   0 1 0 1 1 1 0 1\r\n" +
            "1 0 1 1 1 0 1 0                   0 1 0 1 1 1 0 1\r\n" +
            "1 0 0 0 0 0 1 0                   0 1 0 0 0 0 0 1\r\n" +
            "1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\r\n" +
            "0 0 0 0 0 0 0 0                   0 0 0 0 0 0 0 0\r\n" +
            "            1                                    \r\n" +
            "            0                                    \r\n" +
            "            1                                    \r\n" +
            "            0                                    \r\n" +
            "            1                                    \r\n" +
            "            0                                    \r\n" +
            "            1                                    \r\n" +
            "            0                                    \r\n" +
            "            1                   1 1 1 1 1        \r\n" +
            "0 0 0 0 0 0 0 0 1               1 0 0 0 1        \r\n" +
            "1 1 1 1 1 1 1 0                 1 0 1 0 1        \r\n" +
            "1 0 0 0 0 0 1 0                 1 0 0 0 1        \r\n" +
            "1 0 1 1 1 0 1 0                 1 1 1 1 1        \r\n" +
            "1 0 1 1 1 0 1 0                                  \r\n" +
            "1 0 1 1 1 0 1 0                                  \r\n" +
            "1 0 0 0 0 0 1 0                                  \r\n" +
            "1 1 1 1 1 1 1 0                                  ";

              Assert.AreEqual( expected, matrix.ToString());
        }
Esempio n. 2
0
        public void DataBits()
        {
            const int WIDTH = 21, HEIGHT = 21;

              //System.Diagnostics.Debugger.Launch();

              // Cells other than basic patterns should be filled with zero.
              QRMatrix matrix = new QRMatrix(WIDTH, HEIGHT);

              matrix.AddBasicPatterns(QRVersion.GetVersionByNumber(1));

              BitList bits = new BitList();

              matrix.InsertDataBits(bits, -1);

              string expected =
            "1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1\r\n" +
            "1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\r\n" +
            "1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\r\n" +
            "1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\r\n" +
            "1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\r\n" +
            "1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\r\n" +
            "1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\r\n" +
            "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n" +
            "1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0";

              Assert.AreEqual( expected, matrix.ToString());
        }