public void DoesDatabaseVacancyObjectToDomainObjectMapperChokeInPractice() { // Arrange var mapper = new ApprenticeshipVacancyMappers(); var vacancy = CreateValidDatabaseVacancy(); // Act / Assert no exception mapper.Map <Vacancy, ApprenticeshipVacancy>(vacancy); }
public void DoMappersMapEverything() { // Arrange var x = new ApprenticeshipVacancyMappers(); // Act x.Initialise(); // Assert x.Mapper.AssertConfigurationIsValid(); }
public void DoesDatabaseVacancyObjectMappingRoundTripViaDomainObjectIncludingHardOnes() { // Arrange var mapper = new ApprenticeshipVacancyMappers(); var domainVacancy1 = new Fixture().Create <ApprenticeshipVacancy>(); // Act var databaseVacancy = mapper.Map <ApprenticeshipVacancy, Vacancy>(domainVacancy1); var domainVacancy2 = mapper.Map <Vacancy, ApprenticeshipVacancy>(databaseVacancy); // Assert domainVacancy2.ShouldBeEquivalentTo(domainVacancy1); }
public void DoesApprenticeshipVacancyDomainObjectMappingRoundTripViaDatabaseObjectExcludingHardOnes() { // Arrange var mapper = new ApprenticeshipVacancyMappers(); var databaseVacancy1 = CreateValidDatabaseVacancy(); // Act var domainVacancy = mapper.Map <Vacancy, ApprenticeshipVacancy>(databaseVacancy1); var databaseVacancy2 = mapper.Map <ApprenticeshipVacancy, Vacancy>(domainVacancy); // Assert databaseVacancy2.ShouldBeEquivalentTo(databaseVacancy1, options => ExcludeHardOnes(options)); }
public void DoesDatabaseVacancyObjectMappingRoundTripViaDomainObjectExcludingHardOnes() { // Arrange var mapper = new ApprenticeshipVacancyMappers(); var domainVacancy1 = new Fixture().Create <ApprenticeshipVacancy>(); // Act var databaseVacancy = mapper.Map <ApprenticeshipVacancy, Vacancy>(domainVacancy1); var domainVacancy2 = mapper.Map <Vacancy, ApprenticeshipVacancy>(databaseVacancy); // Assert domainVacancy2.ShouldBeEquivalentTo(domainVacancy1, options => ExcludeHardOnes(options) .Excluding(x => x.LocationAddresses)); // Manually mapped }
public void DoesApprenticeshipVacancyDomainObjectToDatabaseObjectMapperChokeInPractice() { // Arrange var x = new ApprenticeshipVacancyMappers(); var vacancy = new Fixture().Build <ApprenticeshipVacancy>() // .With(av => av.EntityId, Guid.Empty) .With(av => av.Status, ProviderVacancyStatuses.PendingQA) .With(av => av.QAUserName, null) .With(av => av.DateStartedToQA, null) .Create(); // Act / Assert no exception x.Map <ApprenticeshipVacancy, Vacancy>(vacancy); }