public void LiveVacanciesWithLegacyWeeklyWageTypeShouldHaveWageSetFromWeeklyWage() { 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.LegacyWeekly) .With(v => v.WeeklyWage, weeklyWage) .Without(v => v.WageText) .With(v => v.WageUnitId, 2) .Create(); var vacancy = sut.MapToApprenticeshipVacancy(apprenticeshipVacancy); vacancy.VacancyReference.Should().Be(vacancyReference); vacancy.WageUnit.Should().Be(ApiTypes.WageUnit.Weekly); vacancy.WageText.Should().Be("£2,550.00"); }
public void ShouldHaveWageSetForVacanciesWithCustomRangeWageType(int wageUnitId, ApiTypes.WageUnit expectedWageUnit, decimal?lowerBound, decimal?upperBound, string expectedWageText) { 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.WageLowerBound, lowerBound) .With(v => v.WageUpperBound, upperBound) .With(v => v.WageType, (int)LegacyWageType.CustomRange) .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(expectedWageText); }
public void ShouldHaveAppropriateWageDescription(LegacyWageType legacyWageType, string expectedWageText) { 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) .Without(v => v.WeeklyWage) .Without(v => v.WageUnitId) .Create(); var vacancy = sut.MapToApprenticeshipVacancy(apprenticeshipVacancy); vacancy.VacancyReference.Should().Be(vacancyReference); vacancy.WageUnit.Should().Be(ApiTypes.WageUnit.Unspecified); vacancy.WageText.Should().Be(expectedWageText); }
public void ShouldHaveUnknownWageForVacanciesWithLegacyTextWageType() { const int vacancyReference = 1234; const int liveVacancyStatusId = 2; const string unknownwWageText = "Unknown"; 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.LegacyText) .Without(v => v.WageUnitId) .Create(); var vacancy = sut.MapToApprenticeshipVacancy(apprenticeshipVacancy); vacancy.VacancyReference.Should().Be(vacancyReference); vacancy.WageUnit.Should().Be(ApiTypes.WageUnit.Unspecified); vacancy.WageText.Should().Be(unknownwWageText); }
public void SetUp() { _sut = new Register.Api.Mappings.ApprenticeshipMapper(_provideSettings.Object); }
public void SetUp() { var provideSettings = new Mock <IProvideSettings>(); _sut = new Register.Api.Mappings.ApprenticeshipMapper(provideSettings.Object); }