示例#1
0
        public static bool TestIsValid([NotNull] MouseHookHotkey hotkey, Action <MouseHookHotkey> setup)
        {
            setup?.Invoke(hotkey);
            bool isValid = hotkey.IsValid();

            Assert.That(isValid == string.IsNullOrWhiteSpace(hotkey.InvalidReason));
            return(isValid);
        }
示例#2
0
        public static void TestGetVisitor()
        {
            var visitor = A.Fake <IMouseHookHotkeyVisitor>();
            var hotkey  = new MouseHookHotkey {
                HotkeyVisitor = visitor
            };

            Assert.That(hotkey.GetVisitor(), Is.SameAs(visitor));
        }
示例#3
0
 public static void TestActiveAndInit([NotNull] MouseHookHotkey hotkey, Action <MouseHookHotkey> setup, Action <MouseHookHotkey> test, Action <MouseHookHotkey> tearDown)
 {
     setup?.Invoke(hotkey);
     if (test == null)
     {
         Assert.That(true);
     }
     else
     {
         test.Invoke(hotkey);
     }
     tearDown?.Invoke(hotkey);
 }