コード例 #1
0
        public void ToStringOutputsKeyNameOnlyWhenModifierNoneIsSet()
        {
            var hotKey = new HotKey(null);
            hotKey.Modifiers = ModifierKeys.None;
            hotKey.Key = System.Windows.Forms.Keys.None;
            var stringValue = hotKey.ToString();

            Assert.AreEqual("None", stringValue);
        }
コード例 #2
0
        public void ToStringOutputsModifierAndKeyNameWhenOneModifierIsSet()
        {
            var hotKey = new HotKey(null);
            hotKey.Modifiers = ModifierKeys.Control;
            hotKey.Key = System.Windows.Forms.Keys.A;
            var stringValue = hotKey.ToString();

            Assert.AreEqual("Control + A", stringValue);
        }
コード例 #3
0
        public void ToStringOutputsAllSetModifiersAndKeyNameWhenMultipleModifiersAreSet()
        {
            var hotKey = new HotKey(null);
            hotKey.Modifiers = ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Windows;
            hotKey.Key = System.Windows.Forms.Keys.A;
            var stringValue = hotKey.ToString();

            Assert.AreEqual("Control + Shift + Windows + A", stringValue);
        }