public static bool TestCanPerformAction([NotNull] FakeHotkey hotkey, Action <FakeHotkey> setup, Action <FakeHotkey> tearDown) { setup?.Invoke(hotkey); bool canPerformAction = hotkey.CanPerformAction; tearDown?.Invoke(hotkey); return(canPerformAction); }
public static bool TestActiveAndInit([NotNull] FakeHotkey hotkey, Action <FakeHotkey> setup, Action <FakeHotkey> tearDown) { setup?.Invoke(hotkey); bool initialized = hotkey.Initialized; tearDown?.Invoke(hotkey); return(initialized); }
public void WriteJsonTest() { Hotkey hotkey = new FakeHotkey(); Assert.That(() => { using (var writer = new StringWriter()) { using (var jsonWriter = new JsonTextWriter(writer)) { this.hotkeyJsonConverter.WriteJson(jsonWriter, hotkey, this.serializer); } } }, Throws.TypeOf <NotImplementedException>()); }
public void TearDown() { this.fakeHotkey.Dispose(); this.fakeHotkey = null; }
public void SetUp() { this.fakeHotkey = new FakeHotkey(this.action); this.fakeHotkey.SetIsValid(true, null); }