public void LegacyTrayMenuItemProvider_ShouldReturnNull() { var(plugin, host) = PluginHostHelper.Create(); var legacyTrayMenuItemProvider = new LegacyTrayMenuItemProvider(plugin, host.Object); var sut = legacyTrayMenuItemProvider.ProvideMenuItem(); sut.Should().BeNull("because we do not provide an official tray menu item in legacy mode."); }
public void LegacyTrayMenuItemProvider_ShouldAddItemsDirectlyToMainWindowsTrayContextMenu() { var(plugin, host) = PluginHostHelper.Create(); host.Object.CustomConfig.SetBool("traymenulegacymenuprovider_enable", true); var oldItemCount = host.Object.MainWindow.TrayContextMenu.Items.Count; plugin.Initialize(host.Object); var sut = host.Object.MainWindow.TrayContextMenu.Items.Count; sut.Should().Be(oldItemCount + 2, "because we inject two menu items into the official KeePass tray menu"); }
public void Initialize() { (_plugin, _host) = PluginHostHelper.Create(); }