Пример #1
0
        public void WideModeConfiguration()
        {
            var         pane1       = new BoxView();
            var         pane2       = new BoxView();
            TwoPaneView twoPaneView = CreateTwoPaneView(pane1, pane2);

            twoPaneView.MinWideModeWidth = 100;
            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));

            Assert.AreEqual(0, twoPaneView.Children[0].Bounds.X);
            Assert.AreEqual(150, twoPaneView.Children[1].Bounds.X);

            twoPaneView.WideModeConfiguration = TwoPaneViewWideModeConfiguration.RightLeft;

            Assert.AreEqual(150, twoPaneView.Children[0].Bounds.X);
            Assert.AreEqual(0, twoPaneView.Children[1].Bounds.X);

            twoPaneView.WideModeConfiguration = TwoPaneViewWideModeConfiguration.SinglePane;

            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsFalse(twoPaneView.Children[1].IsVisible);

            twoPaneView.PanePriority = TwoPaneViewPriority.Pane2;

            Assert.IsFalse(twoPaneView.Children[0].IsVisible);
            Assert.IsTrue(twoPaneView.Children[1].IsVisible);

            twoPaneView.PanePriority = TwoPaneViewPriority.Pane1;

            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsFalse(twoPaneView.Children[1].IsVisible);
        }
Пример #2
0
        public void PanePriority()
        {
            var pane1 = new BoxView();
            var pane2 = new BoxView();

            TwoPaneView twoPaneView = CreateTwoPaneView(pane1, pane2);

            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));
            twoPaneView.MinWideModeWidth  = 500;
            twoPaneView.MinTallModeHeight = 500;

            Assert.IsFalse(twoPaneView.Children[1].IsVisible);
            Assert.IsTrue(twoPaneView.Children[0].IsVisible);

            Assert.AreEqual(pane1.Height, 300);
            Assert.AreEqual(pane1.Width, 300);

            twoPaneView.PanePriority = TwoPaneViewPriority.Pane2;

            Assert.AreEqual(pane2.Height, 300);
            Assert.AreEqual(pane2.Width, 300);

            Assert.IsFalse(twoPaneView.Children[0].IsVisible);
            Assert.IsTrue(twoPaneView.Children[1].IsVisible);
        }
Пример #3
0
        public void TallModeConfiguration()
        {
            var         pane1       = new BoxView();
            var         pane2       = new BoxView();
            TwoPaneView twoPaneView = CreateTwoPaneView(pane1, pane2);

            twoPaneView.MinTallModeHeight = 100;
            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));

            Assert.AreEqual(0, twoPaneView.Children[0].Bounds.Y);
            Assert.AreEqual(150, twoPaneView.Children[1].Bounds.Y);

            twoPaneView.TallModeConfiguration = TwoPaneViewTallModeConfiguration.BottomTop;

            Assert.AreEqual(150, twoPaneView.Children[0].Bounds.Y);
            Assert.AreEqual(0, twoPaneView.Children[1].Bounds.Y);

            twoPaneView.TallModeConfiguration = TwoPaneViewTallModeConfiguration.SinglePane;

            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsFalse(twoPaneView.Children[1].IsVisible);

            twoPaneView.PanePriority = TwoPaneViewPriority.Pane2;

            Assert.IsFalse(twoPaneView.Children[0].IsVisible);
            Assert.IsTrue(twoPaneView.Children[1].IsVisible);

            twoPaneView.PanePriority = TwoPaneViewPriority.Pane1;

            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsFalse(twoPaneView.Children[1].IsVisible);
        }
Пример #4
0
        public void BasicLayoutTestLandscape()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView(dualScreenService: new TestDualScreenServiceLandscape());

            twoPaneView.Layout(new Rectangle(0, 0, 300, 500));

            Assert.AreEqual(300, twoPaneView.Width);
            Assert.AreEqual(500, twoPaneView.Height);
        }
Пример #5
0
        public void BasicLayoutTestPortrait()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView();

            twoPaneView.Layout(new Rectangle(0, 0, 300, 500));

            Assert.AreEqual(300, twoPaneView.Pane1.Width);
            Assert.AreEqual(500, twoPaneView.Pane1.Height);
        }
Пример #6
0
        public void BasicLayoutTest()
        {
            TwoPaneView twoPaneView = new TwoPaneView();

            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));

            Assert.AreEqual(300, twoPaneView.Height);
            Assert.AreEqual(300, twoPaneView.Width);
        }
Пример #7
0
        public void ModeSwitchesWithMinTallModeHeight()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView();

            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));

            twoPaneView.MinTallModeHeight = 400;
            Assert.AreEqual(TwoPaneViewMode.SinglePane, twoPaneView.Mode);
            twoPaneView.MinTallModeHeight = 100;
            Assert.AreEqual(TwoPaneViewMode.Tall, twoPaneView.Mode);
        }
Пример #8
0
        public void ModeSwitchesWithMinWideModeWidth()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView();

            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));

            twoPaneView.MinWideModeWidth = 400;
            Assert.AreEqual(TwoPaneViewMode.SinglePane, twoPaneView.Mode);
            twoPaneView.MinWideModeWidth = 100;
            Assert.AreEqual(TwoPaneViewMode.Wide, twoPaneView.Mode);
        }
Пример #9
0
        public void BasicLayoutTestSinglePaneLandscape()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView(dualScreenService: new TestDualScreenServiceLandscape());

            twoPaneView.MinWideModeWidth  = 1000;
            twoPaneView.MinTallModeHeight = 1000;
            twoPaneView.Layout(new Rectangle(0, 0, 300, 500));

            Assert.AreEqual(300, twoPaneView.Pane1.Width);
            Assert.AreEqual(500, twoPaneView.Pane1.Height);
        }
Пример #10
0
        public void BasicLayoutTestSinglePanePortrait()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView();

            twoPaneView.MinWideModeWidth  = 1000;
            twoPaneView.MinTallModeHeight = 1000;
            twoPaneView.Layout(new Rectangle(0, 0, 300, 500));

            Assert.AreEqual(300, twoPaneView.Pane1.Width);
            Assert.AreEqual(500, twoPaneView.Pane1.Height);
        }
Пример #11
0
        public void Pane2LengthWideMode()
        {
            var pane1 = new BoxView();
            var pane2 = new BoxView();

            TwoPaneView twoPaneView = CreateTwoPaneView(pane1, pane2);

            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));
            twoPaneView.MinWideModeWidth = 100;
            Assert.AreNotEqual(100, twoPaneView.Pane2.Width);
            twoPaneView.Pane2Length = 100;
            Assert.AreEqual(100, twoPaneView.Pane2.Width);
        }
Пример #12
0
        public void Pane1LengthTallMode()
        {
            var pane1 = new BoxView();
            var pane2 = new BoxView();

            TwoPaneView twoPaneView = CreateTwoPaneView(pane1, pane2);

            twoPaneView.Layout(new Rectangle(0, 0, 300, 300));
            twoPaneView.MinTallModeHeight = 100;
            Assert.AreNotEqual(100, twoPaneView.Pane1.Height);
            twoPaneView.Pane1Length = 100;
            Assert.AreEqual(100, twoPaneView.Pane1.Height);
        }
Пример #13
0
        public void Pane2BecomesVisibleAfterOnlyPane1IsVisibleTallMode()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView();

            twoPaneView.Layout(new Rectangle(0, 0, 300, 500));
            twoPaneView.MinTallModeHeight = 4000;
            twoPaneView.PanePriority      = TwoPaneViewPriority.Pane1;

            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsFalse(twoPaneView.Children[1].IsVisible);
            twoPaneView.MinTallModeHeight = 0;
            Assert.AreEqual(twoPaneView.Mode, TwoPaneViewMode.Tall);
            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsTrue(twoPaneView.Children[1].IsVisible);
        }
Пример #14
0
        public void Pane1BecomesVisibleAfterOnlyPane2IsVisibleWideMode()
        {
            TwoPaneView twoPaneView = CreateTwoPaneView();

            twoPaneView.Layout(new Rectangle(0, 0, 300, 500));
            twoPaneView.MinWideModeWidth = 4000;
            twoPaneView.PanePriority     = TwoPaneViewPriority.Pane2;

            Assert.IsFalse(twoPaneView.Children[0].IsVisible);
            Assert.IsTrue(twoPaneView.Children[1].IsVisible);
            twoPaneView.MinWideModeWidth = 0;
            Assert.AreEqual(twoPaneView.Mode, TwoPaneViewMode.Wide);
            Assert.IsTrue(twoPaneView.Children[0].IsVisible);
            Assert.IsTrue(twoPaneView.Children[1].IsVisible);
        }