public void Handle(MembershipStarted @event)
        {
            var account = new Account(MembershipId.Parse(@event.MembershipId));

            account.Entries.AddMonthlyEntries(12, Money.Parse(@event.InitialFee), dateTimeProvider);
            repository.Add(account);
        }
Beispiel #2
0
        public void ThenTheAccountForTheMembershipShouldHaveTheFollowingDebits(int id, Table table)
        {
            var account = repository.GetById <Account>(MembershipId.Parse(id));

            for (int index = 0; index < table.RowCount; index++)
            {
                AccountEntry accountEntry = account.Entries.ElementAt(index);
                accountEntry.ExpectedPaymentOn.Should().Be(DateTime.Parse(table.Rows[index][0]));
                accountEntry.Value.Should().Be(Money.Parse(Decimal.Parse(table.Rows[index][1])));
            }

            account.Should().NotBeNull();
        }
Beispiel #3
0
 public void Handle(MembershipFeeChanged @event)
 {
     repository
     .GetById <Account>(MembershipId.Parse(@event.MembershipId))
     .Entries.ChangeMonthlyEntries(12, Money.Parse(@event.NewFee));
 }
Beispiel #4
0
 public void ThenAGymMembershipShouldHaveBeenCreatedWithAnIdOf(int id)
 {
     membership = repository.GetById <Membership>(MembershipId.Parse(id));
     membership.Should().NotBeNull();
 }