public virtual PostType MapBOToEF( BOPostType bo) { PostType efPostType = new PostType(); efPostType.SetProperties( bo.Id, bo.Type); return(efPostType); }
public void MapEntityToModel() { var mapper = new DALPostTypeMapper(); PostType item = new PostType(); item.SetProperties(1, "A"); ApiPostTypeServerResponseModel response = mapper.MapEntityToModel(item); response.Id.Should().Be(1); response.RwType.Should().Be("A"); }
public virtual PostType MapModelToEntity( int id, ApiPostTypeServerRequestModel model ) { PostType item = new PostType(); item.SetProperties( id, model.RwType); return(item); }
public void MapEFToBO() { var mapper = new DALPostTypeMapper(); PostType entity = new PostType(); entity.SetProperties(1, "A"); BOPostType response = mapper.MapEFToBO(entity); response.Id.Should().Be(1); response.Type.Should().Be("A"); }
public void MapEntityToModelList() { var mapper = new DALPostTypeMapper(); PostType item = new PostType(); item.SetProperties(1, "A"); List <ApiPostTypeServerResponseModel> response = mapper.MapEntityToModel(new List <PostType>() { { item } }); response.Count.Should().Be(1); }
public void MapEFToBOList() { var mapper = new DALPostTypeMapper(); PostType entity = new PostType(); entity.SetProperties(1, "A"); List <BOPostType> response = mapper.MapEFToBO(new List <PostType>() { entity }); response.Count.Should().Be(1); }