Пример #1
0
        public void CanNotSetColumnsToMoreThanParentSize()
        {
            ColumnContainer target = new ColumnContainer(new RootColumn());

            Assert.IsFalse(target.SetNumberOfColumns(13), "Should not be able to set columns to more than size 12");

            ColumnContainer target2 = new ColumnContainer(new Column()
            {
                Size = ColumnSize.Size5
            });

            Assert.IsFalse(target2.SetNumberOfColumns(6), "Should not be able to set columns to more than size 5");
        }
Пример #2
0
        public void CanSetNumberOfColumns()
        {
            ColumnContainer target = new ColumnContainer(new RootColumn());

            Assert.IsTrue(target.SetNumberOfColumns(3), "Should be able to set three columns");
            Assert.AreEqual(3, target.Columns.Count, "Column Count should be three");


            ColumnContainer target2 = new ColumnContainer(new RootColumn());

            Assert.IsTrue(target2.SetNumberOfColumns(7), "Should be able to set seven columns");
            Assert.AreEqual(7, target2.Columns.Count, "Column Count should be sevent");
        }
Пример #3
0
        public void CanResizeColumnsUsingShorthand()
        {
            RootColumn      root   = new RootColumn();
            ColumnContainer target = new ColumnContainer(root);

            target.SetNumberOfColumns(3);
            Assert.AreEqual(3, target.Columns.Count, "Column Cound should be 3");
            Assert.AreEqual(ColumnSize.Size4, target.Columns[0].Size, "First column number should be size 4");
            Assert.AreEqual(ColumnSize.Size4, target.Columns[1].Size, "Second column number should be size 4");
            Assert.AreEqual(ColumnSize.Size4, target.Columns[2].Size, "Third column number should be size 4");

            Assert.IsTrue(target.SetColumnSizes("10,1,1"), "Column set size should be true");

            Assert.AreEqual(ColumnSize.Size10, target.Columns[0].Size, "First column number should be size 10");
            Assert.AreEqual(ColumnSize.Size1, target.Columns[1].Size, "Second column number should be size 1");
            Assert.AreEqual(ColumnSize.Size1, target.Columns[2].Size, "Third column number should be size 1");
        }
Пример #4
0
        public void CanResizeColumnsUsingShorthand2()
        {
            ColumnContainer target = new ColumnContainer(new Column()
            {
                Size = ColumnSize.Size9
            });

            target.SetNumberOfColumns(5);
            Assert.AreEqual(5, target.Columns.Count, "Column Cound should be 5");

            Assert.IsTrue(target.SetColumnSizes("4w,2w,1,1,1"), "Column set size should be true");

            Assert.AreEqual(ColumnSize.Size4, target.Columns[0].Size, "First column number should be size 4");
            Assert.IsTrue(target.Columns[0].NoGutter, "First Column should have no gutter turned on");
            Assert.AreEqual(ColumnSize.Size2, target.Columns[1].Size, "Second column number should be size 2");
            Assert.IsTrue(target.Columns[1].NoGutter, "Second Column should have no gutter turned on");
            Assert.AreEqual(ColumnSize.Size1, target.Columns[2].Size, "Third column number should be size 1");
            Assert.AreEqual(ColumnSize.Size1, target.Columns[3].Size, "Fourth column number should be size 1");
            Assert.AreEqual(ColumnSize.Size1, target.Columns[4].Size, "Fifth column number should be size 1");
        }
Пример #5
0
        public void CanNotSetColumnsToOne()
        {
            ColumnContainer target = new ColumnContainer(new RootColumn());

            Assert.IsFalse(target.SetNumberOfColumns(1), "Should not be able to set columns to one");
        }