public void ShouldHaveWageSetForVacanciesWithCustomWageType(int?wageUnitId, ApiTypes.WageUnit expectedWageUnit) { const int weeklyWage = 2550; const int vacancyReference = 1234; const int liveVacancyStatusId = 2; var provideSettings = new Mock <IProvideSettings>(); var sut = new Register.Api.Mappings.ApprenticeshipMapper(provideSettings.Object); var apprenticeshipVacancy = new Fixture().Build <ApprenticeshipVacancy>() .With(v => v.VacancyReferenceNumber, vacancyReference) .With(v => v.ApprenticeshipTypeId, 1) .With(v => v.VacancyStatusId, liveVacancyStatusId) .With(v => v.WageType, (int)LegacyWageType.Custom) .With(v => v.WeeklyWage, weeklyWage) .Without(v => v.WageText) .With(v => v.WageUnitId, wageUnitId) .Create(); var vacancy = sut.MapToApprenticeshipVacancy(apprenticeshipVacancy); vacancy.VacancyReference.Should().Be(vacancyReference); vacancy.WageUnit.Should().Be(expectedWageUnit); vacancy.WageText.Should().Be("£2,550.00"); }
public void ThenMapWageUnit(string wageType, ApiTypes.WageUnit wageUnit) { var sut = GetRecruitApprecticeshipMapper(); LiveVacancy.Wage = FixtureInstance.Build <Wage>().With(w => w.WageType, wageType).Create(); var mappedVacancy = sut.MapFromRecruitVacancy(LiveVacancy).Result; mappedVacancy.WageUnit.Should().Be(wageUnit); }
public void ShouldMapWageUnitIdToWageUnitEnum(int?wageUnitId, ApiTypes.WageUnit wageUnitType, int expectedWageUnitUnderlyingValue) { //Arrange var apprenticeshipVacancy = new Fixture().Build <ApprenticeshipVacancy>() .With(v => v.WageType, (int)LegacyWageType.Custom) .With(v => v.ApprenticeshipTypeId, 1) .With(v => v.WageUnitId, wageUnitId) .Create(); //Act var vacancy = _sut.MapToApprenticeshipVacancy(apprenticeshipVacancy); //Assert vacancy.WageUnit.ShouldBeEquivalentTo(wageUnitType); vacancy.WageUnit.ShouldBeEquivalentTo(expectedWageUnitUnderlyingValue); }