public void GetPluginMenuItemsTest() { FileInfo _fileInforFixture = new FileInfo(ConfigurationPath); Mock <IConfiguration> _iConfigurationMock = new Mock <IConfiguration>(); _iConfigurationMock.Setup(x => x.SaveConfiguration(It.IsAny <string>(), _fileInforFixture)); Mock <IGraphicalUserInterface> _iGraphicalUserInterface = new Mock <IGraphicalUserInterface>(); ConfigurationWrapper _underTestItem = new ConfigurationWrapper(_fileInforFixture, _iConfigurationMock.Object, _iGraphicalUserInterface.Object); List <ToolStripItem> _menuItems = new List <ToolStripItem>(); _underTestItem.GetPluginMenuItems(_menuItems); Assert.AreEqual <int>(1, _menuItems.Count); Assert.AreEqual <int>(5, ((ToolStripMenuItem)_menuItems[0]).DropDownItems.Count); Assert.AreEqual <string>("Save", ((ToolStripMenuItem)_menuItems[0]).DropDownItems[2].Text); ((ToolStripMenuItem)_menuItems[0]).DropDownItems[2].PerformClick(); _underTestItem.SetHomeDirectory(@"C:\x\y\z"); ((ToolStripMenuItem)_menuItems[0]).DropDownItems[2].PerformClick(); _iConfigurationMock.Verify(x => x.SaveConfiguration(null, _fileInforFixture), Times.Once); _iConfigurationMock.Verify(x => x.SaveConfiguration(@"C:\x\y\z", _fileInforFixture), Times.Once); }