Esempio n. 1
0
        public void Should_notify_the_customer_that_his_membership_was_activated()
        {
            var customer   = new Customer(Mail);
            var membership = new Membership("Premium membership");

            customer.ActivateMembership(membership);

            _domainEventNotifier
            .Received().NotifyAbout(Arg.Is <DomainEvent>(@event => @event is MembershipActivated));
        }
Esempio n. 2
0
        public void Should_add_a_membership_to_a_customer()
        {
            var customer   = new Customer(Mail);
            var membership = new Membership("Premium membership");
            var expectedCustomerMemberships = new[] { new CustomerMembership(membership, customer) };

            customer.ActivateMembership(membership);

            Assert.Equal(expectedCustomerMemberships, customer.Memberships);
        }