コード例 #1
0
        public void TestTableLayoutNineItemsTwoRows()
        {
            Vector2 size = new Vector2(18, 3);

            List <string> lines = new List <string>();

            lines.Add("1111");
            lines.Add("2222");
            lines.Add("3333");
            lines.Add("4444");
            lines.Add("5555");
            lines.Add("6666");
            lines.Add("7777");
            lines.Add("8888");
            lines.Add("9999");

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray());

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "1111" + kSpace + "4444" + kSpace + "7777" + "\n" +
                                  "2222" + kSpace + "5555" + kSpace + "8888" + "\n" +
                                  "3333" + kSpace + "6666" + kSpace + "9999"
                                  );
        }
コード例 #2
0
        public void TestFlowLayoutSinglelWordMoreThanMaxWidth()
        {
            Vector2 size = new Vector2(5, 1);

            string line = "12345";
            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(line);

            entry.Layout(this, size.x - 1);

            AssertCellEntryLayout(entry, size,
                                  "12345"
                                  );
        }
コード例 #3
0
        public void TestTableLayoutThreeItemsSingleRow()
        {
            Vector2 size = new Vector2(18, 1);

            string[] lines = { "111", "22", "3333" };

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines);

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "111 " + kSpace + "22  " + kSpace + "3333"
                                  );
        }
コード例 #4
0
        public void TestTableLayoutSingleItem()
        {
            Vector2 size = new Vector2(14, 1);

            string[] lines = { "1111" };

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines);

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "1111"
                                  );
        }
コード例 #5
0
        public void TestTableLayoutFourItemsTwoRows()
        {
            Vector2 size = new Vector2(14, 2);

            string[] lines = { "1111", "2222", "3333", "4444" };

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines);

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "1111" + kSpace + "3333" + "\n" +
                                  "2222" + kSpace + "4444"
                                  );
        }
コード例 #6
0
        public void TestTableLayoutSingleLongItemDontFit()
        {
            Vector2 size = new Vector2(3, 1);

            List <string> lines = new List <string>();

            lines.Add("1111");

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray());

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "1111"
                                  );
        }
コード例 #7
0
        public void TestTableLayoutTwoItemsDifferentSizeSingleRow()
        {
            Vector2 size = new Vector2(18, 1);

            List <string> lines = new List <string>();

            lines.Add("1111");
            lines.Add("222222");

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray());

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "1111  " + kSpace + "222222"
                                  );
        }
コード例 #8
0
        public void TestTableLayoutTwoItemsDifferentSizeThreeRows()
        {
            Vector2 size = new Vector2(14, 3);

            List <string> lines = new List <string>();

            lines.Add("1111");
            lines.Add("222222");
            lines.Add("333333333");

            ConsoleViewCellEntry entry = new ConsoleViewCellEntry(lines.ToArray());

            entry.Layout(this, size.x);

            AssertCellEntryLayout(entry, size,
                                  "1111" + "\n" +
                                  "222222" + "\n" +
                                  "333333333"
                                  );
        }