public void When_adding_a_view_to_the_layout_should_add_view_to_panel_children_collection()
        {
            Panel element = new DockPanel();
            PanelDecoratingLayout layout = new PanelDecoratingLayout(element);

            layout.AddView(new DemoView());
            Assert.AreEqual(1, element.Children.Count);
        }
Ejemplo n.º 2
0
        public void When_asked_about_accepting_a_view_with_an_unknown_name_should_return_false()
        {
            DockPanel panel = new DockPanel {
                Name = "Uknnown"
            };
            PanelDecoratingLayout layout   = new PanelDecoratingLayout(panel);
            DefaultLayoutSelector selector = new DefaultLayoutSelector(new Hashtable());

            bool result = selector.CanAccept(layout, new DemoView());

            Assert.IsFalse(result);
        }
Ejemplo n.º 3
0
        public void When_asked_about_accepting_a_view_with_same_name_and_no_override_defined_should_return_true()
        {
            DockPanel panel = new DockPanel {
                Name = "Demo"
            };
            PanelDecoratingLayout layout   = new PanelDecoratingLayout(panel);
            DefaultLayoutSelector selector = new DefaultLayoutSelector(new Hashtable());

            bool result = selector.CanAccept(layout, new DemoView());

            Assert.IsTrue(result);
        }
Ejemplo n.º 4
0
        public void When_selector_has_configuration_for_layout_will_use_that_to_check_if_valid_view_for_layout()
        {
            DockPanel panel = new DockPanel {
                Name = "WithConfig"
            };
            PanelDecoratingLayout layout = new PanelDecoratingLayout(panel);
            var hash = new Hashtable();

            hash[layout.Name] = new[] { "WithConfig" };

            DefaultLayoutSelector selector = new DefaultLayoutSelector(hash);

            bool result = selector.CanAccept(layout, new DemoView());

            Assert.IsFalse(result);
        }