public void WhenEventIsRaisedItIsAddedToEvents() { Bank target = new Bank(1); target.OpenAccount(new OpenAccount("Jan")); var evt = target.Events.First(); Assert.IsInstanceOfType(evt, typeof(AccountOpened)); AccountOpened ao = (AccountOpened)evt; Assert.AreEqual("Jan", ao.Owner); }
public void Handle(AccountOpened accountOpened) { HandleAccountOpenedCallCount++; HandleAccountOpenedArgument = accountOpened; HandleAccountIsReplaying = IsReplaying; }
public void OpenAccount(OpenAccount command) { AccountOpened accountOpened = new AccountOpened(1, command.Owner); RaiseEvent(accountOpened); }