예제 #1
0
        /**
         * Helper methods to set up the Given state
         */
        private void givenARegisteredCustomer()
        {
            var register = RegisterCustomer.Build(emailAddress.Value, name.GivenName, name.FamilyName);

            customerID         = register.CustomerId;
            confirmationHash   = register.ConfirmationHash;
            registeredCustomer = Customer1.Register(register);
        }
예제 #2
0
        void registerCustomer()
        {
            // When registerCustomer
            var command  = RegisterCustomer.Build(emailAddress.Value, name.GivenName, name.FamilyName);
            var customer = Customer1.Register(command);

            // Then it should succeed
            // and should have the expected state
            Assert.NotNull(customer);
            Assert.Equal(customer.CustomerId, command.CustomerId);
            Assert.Equal(customer.Name, command.Name);
            Assert.Equal(customer.EmailAddress, command.EmailAddress);
            Assert.Equal(customer.ConfirmationHash, command.ConfirmationHash);
            Assert.False(customer.IsEmailAddressConfirmed);
        }