Ejemplo n.º 1
0
        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.");
        }
Ejemplo n.º 2
0
        public void TrayMenuItemProvider_ShouldReturnNullIfDeactivated()
        {
            var(plugin, host) = PluginHostHelper.CreateAndInitialize();
            plugin.Settings.NotifyContextVisible = false;

            var trayMenuItemProvider = new TrayMenuItemProvider(plugin, host.Object);

            var sut = trayMenuItemProvider.ProvideMenuItem();

            sut.Should().BeNull();
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
        public void Initialize()
        {
            var(plugin, host) = PluginHostHelper.CreateAndInitialize();

            _trayMenuItemProvider = new TrayMenuItemProvider(plugin, host.Object);
        }
Ejemplo n.º 5
0
 public void Initialize()
 {
     (_plugin, _host) = PluginHostHelper.Create();
 }