コード例 #1
0
        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);
        }
コード例 #2
0
 public void Handle(AccountOpened accountOpened)
 {
     HandleAccountOpenedCallCount++;
     HandleAccountOpenedArgument = accountOpened;
     HandleAccountIsReplaying    = IsReplaying;
 }
コード例 #3
0
        public void OpenAccount(OpenAccount command)
        {
            AccountOpened accountOpened = new AccountOpened(1, command.Owner);

            RaiseEvent(accountOpened);
        }