public void CommandHasNotBeenHandled__ReturnsFalse() { var t = new Test(); t.TryHandleCommand += (s, e) => { }; t.TryHandleCommand += (s, e) => { }; var r = t.TryHandle(); Assert.IsFalse(r); }
public void CommandHasBeenHandled__ReturnsTrue() { var t = new Test(); t.TryHandleCommand += (s, e) => { }; t.TryHandleCommand += (s, e) => { e.Handle(); }; t.TryHandleCommand += (s, e) => { Assert.Fail("should not be called, previous event handler handles the command."); }; var r = t.TryHandle(); Assert.IsTrue(r); }