Exemplo n.º 1
0
        public void FactoryCreatesCorrectAdapterForMenuStrip()
        {
            ToolStripUIAdapterFactory factory = new ToolStripUIAdapterFactory();
            IUIElementAdapter         adapter = factory.GetAdapter(new MenuStrip());

            Assert.IsTrue(adapter is ToolStripItemCollectionUIAdapter);
        }
Exemplo n.º 2
0
        public void FactoryCreatesCorrectAdapterForToolStripMenuItem()
        {
            ToolStripUIAdapterFactory factory = new ToolStripUIAdapterFactory();
            ToolStrip         strip           = new ToolStrip();
            ToolStripMenuItem item            = new ToolStripMenuItem();

            strip.Items.Add(item);
            IUIElementAdapter adapter = factory.GetAdapter(item);

            Assert.IsTrue(adapter is ToolStripItemOwnerCollectionUIAdapter);
        }
Exemplo n.º 3
0
        public void FactorySupportsCorrectTypes()
        {
            ToolStripUIAdapterFactory factory = new ToolStripUIAdapterFactory();
            ToolStrip strip = new ToolStrip();

            Assert.IsTrue(factory.Supports(new ToolStrip()));
            Assert.IsTrue(factory.Supports(new MenuStrip()));
            Assert.IsTrue(factory.Supports(new ToolStripButton()));             // Derived from ToolStripItem
            Assert.IsTrue(factory.Supports(new ToolStripMenuItem()));
            Assert.IsTrue(factory.Supports(new ToolStripDropDownMenu()));
            Assert.IsTrue(factory.Supports(strip.Items));
        }