/** * Methods for WHEN */ private void WHEN_RegisterCustomer() { var registerCustomer = Shared.Command.RegisterCustomer.Build(emailAddress.Value, name.GivenName, name.FamilyName); customerRegistered = Customer5.Register(registerCustomer); customerID = registerCustomer.CustomerId; confirmationHash = registerCustomer.ConfirmationHash; }
private void WHEN_ConfirmEmailAddress_With(Hash confirmationHash) { var command = ConfirmCustomerEmailAddress.Build(customerID.Value, confirmationHash.Value); try { recordedEvents = Customer5.ConfirmEmailAddress(eventStream, command); } catch (NullReferenceException e) { throw new XunitException(THelper.propertyIsNull("confirmationHash")); } }
private void WHEN_ChangeEmailAddress_With(EmailAddress emailAddress) { var command = ChangeCustomerEmailAddress.Build(customerID.Value, emailAddress.Value); try { recordedEvents = Customer5.ChangeEmailAddress(eventStream, command); changedConfirmationHash = command.ConfirmationHash; } catch (NullReferenceException e) { throw new XunitException(THelper.propertyIsNull("emailAddress")); } }