Ejemplo n.º 1
0
        public void read_hotkeys_and_dont_accept_invalds(string hotkey)
        {
            HotkeysProbe keys = new HotkeysProbe();

            var settings = new Mock<ISettingsReader>();
            settings.SetupGet(m => m["Hotkeys:Play"]).Returns(hotkey);

            keys.ReadSettings(settings.Object);

            keys.Hotkeys.Should().BeEmpty();
        }
Ejemplo n.º 2
0
        public void ensure_default_buttons()
        {
            HotkeysProbe keys = new HotkeysProbe();

            var settings = new Mock<ISettingsReader>();

            keys.ReadSettings(settings.Object);

            settings.Verify(m => m.EnsureKey("Hotkeys:Play", It.IsAny<string>()));
            settings.Verify(m => m.EnsureKey("Hotkeys:Pause", It.IsAny<string>()));
            settings.Verify(m => m.EnsureKey("Hotkeys:PreviousTrack", It.IsAny<string>()));
            settings.Verify(m => m.EnsureKey("Hotkeys:NextTrack", It.IsAny<string>()));
        }
Ejemplo n.º 3
0
        public void read_hotkeys(string hotkey)
        {
            HotkeysProbe keys = new HotkeysProbe();

            var settings = new Mock<ISettingsReader>();
            settings.SetupGet(m => m["Hotkeys:Play"]).Returns(hotkey);

            keys.ReadSettings(settings.Object);

            var key = keys.Hotkeys.First();
            key.Shift.Should().BeTrue();
            key.Alt.Should().BeTrue();
            key.Ctrl.Should().BeTrue();
            key.KeyCode.Should().Be(Keys.Up);

            key.Enabled = false;
            key.Dispose();
        }
Ejemplo n.º 4
0
        public void read_hotkeys_key(string hotkey, System.Windows.Forms.Keys expected)
        {
            HotkeysProbe keys = new HotkeysProbe();

            var settings = new Mock<ISettingsReader>();
            settings.SetupGet(m => m["Hotkeys:Play"]).Returns(hotkey);

            keys.ReadSettings(settings.Object);

            var key = keys.Hotkeys.First();
            key.KeyCode.Should().Be(expected);

            key.Enabled = false;
            key.Dispose();
        }