Esempio n. 1
0
        public void RegisterDelegateByCentre_schedules_welcome_email_if_notify_date_set()
        {
            // Given
            const string baseUrl = "base.com";
            var          model   = RegistrationModelTestHelper.GetDefaultDelegateRegistrationModel(
                passwordHash: null,
                notifyDate: new DateTime(2200, 1, 1)
                );

            A.CallTo(() => registrationDataService.RegisterDelegate(model)).Returns(NewCandidateNumber);

            // When
            registrationService.RegisterDelegateByCentre(model, baseUrl);

            // Then
            A.CallTo(
                () => passwordResetService.GenerateAndScheduleDelegateWelcomeEmail(
                    model.Email,
                    NewCandidateNumber,
                    baseUrl,
                    model.NotifyDate.Value,
                    "RegisterDelegateByCentre_Refactor"
                    )
                ).MustHaveHappened(1, Times.Exactly);
        }