Exemple #1
0
        public void ThenMapTrainingType(string trainingType, ApiTypes.TrainingType expectedOuput)
        {
            TrainingDetailServiceMock
            .Setup(t => t.GetFrameworkDetailsAsync(It.IsAny <int>()))
            .ReturnsAsync(FixtureInstance.Create <Framework>());
            TrainingDetailServiceMock
            .Setup(t => t.GetStandardDetailsAsync(It.IsAny <int>()))
            .ReturnsAsync(FixtureInstance.Create <Standard>());

            var sut = GetRecruitApprecticeshipMapper();

            LiveVacancy.ProgrammeType = trainingType;

            var mappedVacancy = sut.MapFromRecruitVacancy(LiveVacancy).Result;

            mappedVacancy.TrainingType.Should().Be(expectedOuput);
        }
Exemple #2
0
        public void AndTrainingTypeIsFramework()
        {
            var framework = FixtureInstance.Create <Framework>();

            TrainingDetailServiceMock
            .Setup(t => t.GetFrameworkDetailsAsync(It.IsAny <int>()))
            .ReturnsAsync(framework);

            var sut = GetRecruitApprecticeshipMapper();

            LiveVacancy.ProgrammeType = "Framework";

            var mappedVacancy = sut.MapFromRecruitVacancy(LiveVacancy).Result;

            mappedVacancy.TrainingTitle.Should().Be(framework.Title);

            TrainingDetailServiceMock.Verify(t => t.GetStandardDetailsAsync(It.IsAny <int>()), Times.Never);
        }