/** * Methods for WHEN */ private void WHEN_RegisterCustomer() { var registerCustomer = RegisterCustomer.Build(emailAddress.Value, name.GivenName, name.FamilyName); customerRegistered = Customer7.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 = Customer7.ConfirmEmailAddress(currentState, 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 = Customer7.ChangeEmailAddress(currentState, command); changedConfirmationHash = command.ConfirmationHash; } catch (NullReferenceException e) { throw new XunitException(THelper.propertyIsNull("emailAddress")); } }