Beispiel #1
0
        public void ShouldHonourSendApplicationSubmittedCommunicationPreference(
            CommunicationChannels communicationChannel, bool preference, bool expectedResult)
        {
            // Arrange.
            var candidate = new CandidateBuilder(Guid.NewGuid())
                            .EnableAllCommunications()
                            .Build();

            // Act.
            var sendApprenticeshipApplicationSubmitted = candidate.ShouldSendMessageViaChannel(
                communicationChannel, MessageTypes.ApprenticeshipApplicationSubmitted);

            var sendTraineeshipApplicationSubmitted = candidate.ShouldSendMessageViaChannel(
                communicationChannel, MessageTypes.TraineeshipApplicationSubmitted);

            // Assert.
            sendApprenticeshipApplicationSubmitted.Should().Be(expectedResult);
            sendTraineeshipApplicationSubmitted.Should().Be(expectedResult);
        }
Beispiel #2
0
        public void ShouldSendMandatoryMobileVerificationCodeViaSmsOnly(
            CommunicationChannels communicationChannel, MessageTypes messageType, bool expectedResult)
        {
            // Arrange.
            var candidate = new CandidateBuilder(Guid.NewGuid())
                            .EnableAllCommunications(false)
                            .Build();

            // Act.
            var result = candidate.ShouldSendMessageViaChannel(
                communicationChannel, messageType);

            // Assert.
            result.Should().Be(expectedResult);
        }
Beispiel #3
0
        public void ShouldHonourSendSavedSearchAlertsViaTextCommunicationPreference(
            CommunicationChannels communicationChannel, bool preference, bool expectedResult)
        {
            // Arrange.
            var candidate = new CandidateBuilder(Guid.NewGuid())
                            .EnableAllCommunications()
                            .EnableSavedSearchAlertsViaEmail(false)
                            .EnableSavedSearchAlertsViaText(preference)
                            .Build();

            // Act.
            var result = candidate.ShouldSendMessageViaChannel(
                communicationChannel, MessageTypes.SavedSearchAlert);

            // Assert.
            result.Should().Be(expectedResult);
        }
Beispiel #4
0
        public void ShouldHonourSendApplicationStatusChangesPreferenceViaSms(
            CommunicationChannels communicationChannel,
            MessageTypes messageType,
            bool sendApplicationStatusChangesViaText,
            bool expectedResult)
        {
            // Arrange.
            var candidate = new CandidateBuilder(Guid.NewGuid())
                            .EnableAllCommunications()
                            .EnableApplicationStatusChangeAlertsViaText(sendApplicationStatusChangesViaText)
                            .Build();

            // Act.
            var result = candidate.ShouldSendMessageViaChannel(
                communicationChannel, messageType);

            // Assert.
            result.Should().Be(expectedResult);
        }
Beispiel #5
0
        public void ShouldHonourDailyDigestPreferencesViaEmail(
            CommunicationChannels communicationChannel,
            MessageTypes messageType,
            bool sendApplicationStatusChangesViaEmail,
            bool sendApprenticeshipApplicationsExpiringViaEmail,
            bool expectedResult)
        {
            // Arrange.
            var candidate = new CandidateBuilder(Guid.NewGuid())
                            .EnableAllCommunications()
                            .EnableApplicationStatusChangeAlertsViaEmail(sendApplicationStatusChangesViaEmail)
                            .EnableApplicationStatusChangeAlertsViaText(true)
                            .EnableExpiringApplicationAlertsViaEmail(sendApprenticeshipApplicationsExpiringViaEmail)
                            .EnableExpiringApplicationAlertsViaText(true)
                            .Build();

            // Act.
            var result = candidate.ShouldSendMessageViaChannel(
                communicationChannel, messageType);

            // Assert.
            result.Should().Be(expectedResult);
        }