/** * 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 = Customer2.Register(register); }
void registerCustomer() { // When var command = RegisterCustomer.Build(emailAddress.Value, name.GivenName, name.FamilyName); var customer = Customer2.Register(command); // Then it should succeed // and it should expose the expected state Assert.NotNull(customer); Assert.Equal(command.CustomerId, customer.CustomerId); Assert.Equal(command.Name, customer.Name); Assert.Equal(command.EmailAddress, customer.EmailAddress); Assert.Equal(command.ConfirmationHash, customer.ConfirmationHash); Assert.False(customer.IsEmailAddressConfirmed); }