public void FactoryCreatesCorrectAdapterForMenuStrip() { ToolStripUIAdapterFactory factory = new ToolStripUIAdapterFactory(); IUIElementAdapter adapter = factory.GetAdapter(new MenuStrip()); Assert.IsTrue(adapter is ToolStripItemCollectionUIAdapter); }
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); }
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)); }