Exemplo n.º 1
0
        public void Test_ElementList()
        {
            ElementList elementList = new ElementList(0, 0, true);
            Label       a           = new Label(0, 0, "A");
            Label       b           = new Label(0, 0, "B");
            Label       c           = new Label(0, 0, "C");

            elementList.AddElement(a);
            elementList.AddElements(b, c);

            elementList.Reorder();

            Assert.AreEqual(0, a.X);
            Assert.AreEqual(1, b.X);
            Assert.AreEqual(2, c.X);

            elementList.X = 1;

            Assert.AreEqual(1, a.X);
            Assert.AreEqual(2, b.X);
            Assert.AreEqual(3, c.X);

            elementList.Horizontal = false;

            Assert.AreEqual(1, a.X);
            Assert.AreEqual(1, b.X);
            Assert.AreEqual(1, c.X);
            Assert.AreEqual(0, a.Y);
            Assert.AreEqual(1, b.Y);
            Assert.AreEqual(2, c.Y);

            elementList.Padding = 1;

            Assert.AreEqual(0, a.Y);
            Assert.AreEqual(2, b.Y);
            Assert.AreEqual(4, c.Y);
        }