Esempio n. 1
0
        public void TestSplitPortrait()
        {
            var root   = new ArrangeNode <string>(90, 100);
            var split  = root.Split(new IntDimension(10, 5));
            var left   = split.Item1;
            var bottom = split.Item2;

            left.SpaceAvailableY.Should().Be(5);
            bottom.SpaceAvailableX.Should().Be(90);
        }
Esempio n. 2
0
        public void TestSplitLandscape()
        {
            var root   = new ArrangeNode <string>(100, 90);
            var split  = root.Split(new IntDimension(10, 5));
            var left   = split.Item1;
            var bottom = split.Item2;

            Console.WriteLine(root);
            Console.WriteLine("  left   = " + left);
            Console.WriteLine("  bottom = " + bottom);

            left.SpaceAvailableY.Should().Be(5);
            bottom.SpaceAvailableX.Should().Be(100);
        }
Esempio n. 3
0
        public void TestSplitQuad()
        {
            var root = new ArrangeNode <string>(100, 100);

            root.Insert(new IntDimension(10, 10), "A");
            root.Insert(new IntDimension(10, 10), "B");
            root.Insert(new IntDimension(10, 10), "C");

            var ip = root.FindInsertPosition(new IntDimension(10, 10));

            ip.Content.Should().BeNull();
            ip.X.Should().Be(10);
            ip.Y.Should().Be(10);
        }