public void Test_Constructor_ShouldSetControlFactory() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var contextMenuBuilderWin = new ContextMenuBuilderWin(GlobalUIRegistry.ControlFactory); //---------------Test Result ----------------------- var controlFactory = contextMenuBuilderWin.ControlFactory; Assert.IsNotNull(controlFactory); Assert.IsInstanceOf<ControlFactoryWin>(controlFactory); }
public void Test_BuildMainMenu_ShouldReturnTypeOf_ContextMenuWin() { //---------------Set up test pack------------------- //---------------Set up test pack------------------- IMenuBuilder contextMenuBuilderWin = new ContextMenuBuilderWin(GlobalUIRegistry.ControlFactory); HabaneroMenu habaneroMenu = new HabaneroMenu("Main"); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var menu = contextMenuBuilderWin.BuildMainMenu(habaneroMenu); //---------------Test Result ----------------------- Assert.IsInstanceOf <ContextMenuWin>(menu); }
public void Test_Constructor_ShouldSetControlFactory() { //---------------Set up test pack------------------- //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var contextMenuBuilderWin = new ContextMenuBuilderWin(GlobalUIRegistry.ControlFactory); //---------------Test Result ----------------------- var controlFactory = contextMenuBuilderWin.ControlFactory; Assert.IsNotNull(controlFactory); Assert.IsInstanceOf <ControlFactoryWin>(controlFactory); }
public void Test_BuildMainMenu_ShouldReturnTypeOf_ContextMenuWin() { //---------------Set up test pack------------------- //---------------Set up test pack------------------- IMenuBuilder contextMenuBuilderWin = new ContextMenuBuilderWin(GlobalUIRegistry.ControlFactory); HabaneroMenu habaneroMenu = new HabaneroMenu("Main"); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var menu = contextMenuBuilderWin.BuildMainMenu(habaneroMenu); //---------------Test Result ----------------------- Assert.IsInstanceOf<ContextMenuWin>(menu); }
public void Test_BuildMainMenu_WhenAddingHabaneroMenuWithOneMenuItem_ShouldReturnMenuWithOneMenuItem() { //---------------Set up test pack------------------- IMenuBuilder contextMenuBuilderWin = new ContextMenuBuilderWin(GlobalUIRegistry.ControlFactory); HabaneroMenu habaneroMenu = new HabaneroMenu("Main"); string menuNameItem = "test"; habaneroMenu.AddMenuItem(menuNameItem); //---------------Assert Precondition---------------- Assert.AreEqual(1, habaneroMenu.MenuItems.Count); //---------------Execute Test ---------------------- var menu = contextMenuBuilderWin.BuildMainMenu(habaneroMenu); //---------------Test Result ----------------------- Assert.AreEqual(1, menu.MenuItems.Count); }
public void Test_BuildMainMenu_WhenAddingHabaneroMenuWithOneMenuItem_ShouldReturnMenuWithOneMenuItem() { //---------------Set up test pack------------------- IMenuBuilder contextMenuBuilderWin = new ContextMenuBuilderWin(GlobalUIRegistry.ControlFactory); HabaneroMenu habaneroMenu = new HabaneroMenu("Main"); string menuNameItem = "test"; habaneroMenu.AddMenuItem(menuNameItem); //---------------Assert Precondition---------------- Assert.AreEqual(1, habaneroMenu.MenuItems.Count); //---------------Execute Test ---------------------- var menu = contextMenuBuilderWin.BuildMainMenu(habaneroMenu); //---------------Test Result ----------------------- Assert.AreEqual(1, menu.MenuItems.Count); }