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); }
public static void TestGetVisitor() { var visitor = A.Fake <IMouseHookHotkeyVisitor>(); var hotkey = new MouseHookHotkey { HotkeyVisitor = visitor }; Assert.That(hotkey.GetVisitor(), Is.SameAs(visitor)); }
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); }