public void TestProjectionMappingBookTitleBadType() { //SETUP var wrappedMapper = AutoMapperHelpers.CreateWrapperMapper <Book, BookTitleBadType>(); //ATTEMPT wrappedMapper.MapperSaveConfig.AssertConfigurationIsValid(); //VERIFY //Doesn't error on name fit but different }
public void TestProjectionMappingBookTitle() { //SETUP var wrappedMapper = AutoMapperHelpers.CreateWrapperMapper <Book, BookTitle>(); //ATTEMPT var input = DddEfTestData.CreateFourBooks().AsQueryable(); var list = input.ProjectTo <BookTitle>(wrappedMapper.MapperReadConfig).ToList(); //VERIFY list.First().Title.ShouldEqual("Refactoring"); }
public void TestDirectMappingBookTitle() { //SETUP var wrappedMapper = AutoMapperHelpers.CreateWrapperMapper <Book, BookTitle>(); //ATTEMPT var input = DddEfTestData.CreateFourBooks().First(); var data = wrappedMapper.MapperSaveConfig.CreateMapper().Map <BookTitle>(input); //VERIFY data.Title.ShouldEqual("Refactoring"); }
public void TestDirectMappingToBookNotSetPrivateSetter() { //SETUP var wrappedMapper = AutoMapperHelpers.CreateWrapperMapper <BookTitle, Book>(); var entity = DddEfTestData.CreateFourBooks().First(); //ATTEMPT var dto = new BookTitle { Title = "New Title" }; var data = wrappedMapper.MapperSaveConfig.CreateMapper().Map(dto, entity); //VERIFY data.Title.ShouldEqual("Refactoring"); }