Example #1
0
        public void OneContextTwoNodes()
        {
            Gtk.Application.Init ();

            string context = "Context1";
            TestModel model = new TestModel();
            /*INode nodeA = */model.CreateAddNode(10, context, new Size(80, 50));
            /*INode nodeB = */model.CreateAddNode(20, context, new Size(100, 40));
            TimelineLayoutManager layout = new TimelineLayoutManager(model);
            layout.Update();

            TestRenderer renderer = new TestRenderer();
            TimelineView view = new TimelineView(model, renderer);

            Gtk.Widget[] children = view.Children;

            Assert.That(children.Length, Is.EqualTo(2));

            Assert.That(children[0].Visible, Is.True);
            Assert.That(children[1].Visible, Is.True);

            int ax = (int) view.ChildGetProperty(children[0], "x").Val;
            int ay = (int) view.ChildGetProperty(children[0], "y").Val;
            int bx = (int) view.ChildGetProperty(children[1], "x").Val;
            int by = (int) view.ChildGetProperty(children[1], "y").Val;

            Assert.That(ay, Is.GreaterThan(0));
            Assert.That(ay, Is.EqualTo(by));

            Assert.That(ax, Is.GreaterThan(0));
            Assert.That(bx, Is.GreaterThan(0));
            Assert.That(ax, Is.Not.EqualTo(bx));
        }