public void MapEntityToModelList() { var mapper = new DALPostHistoryMapper(); PostHistory item = new PostHistory(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, "A", "A", "A", 1); List <ApiPostHistoryServerResponseModel> response = mapper.MapEntityToModel(new List <PostHistory>() { { item } }); response.Count.Should().Be(1); }
public void MapEFToBOList() { var mapper = new DALPostHistoryMapper(); PostHistory entity = new PostHistory(); entity.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, "A", "A", "A", 1); List <BOPostHistory> response = mapper.MapEFToBO(new List <PostHistory>() { entity }); response.Count.Should().Be(1); }
public virtual PostHistory MapBOToEF( BOPostHistory bo) { PostHistory efPostHistory = new PostHistory(); efPostHistory.SetProperties( bo.Comment, bo.CreationDate, bo.Id, bo.PostHistoryTypeId, bo.PostId, bo.RevisionGUID, bo.Text, bo.UserDisplayName, bo.UserId); return(efPostHistory); }
public void MapEntityToModel() { var mapper = new DALPostHistoryMapper(); PostHistory item = new PostHistory(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, "A", "A", "A", 1); ApiPostHistoryServerResponseModel response = mapper.MapEntityToModel(item); response.Comment.Should().Be("A"); response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be(1); response.PostHistoryTypeId.Should().Be(1); response.PostId.Should().Be(1); response.RevisionGUID.Should().Be("A"); response.Text.Should().Be("A"); response.UserDisplayName.Should().Be("A"); response.UserId.Should().Be(1); }
public void MapEFToBO() { var mapper = new DALPostHistoryMapper(); PostHistory entity = new PostHistory(); entity.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, 1, "A", "A", "A", 1); BOPostHistory response = mapper.MapEFToBO(entity); response.Comment.Should().Be("A"); response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.Id.Should().Be(1); response.PostHistoryTypeId.Should().Be(1); response.PostId.Should().Be(1); response.RevisionGUID.Should().Be("A"); response.Text.Should().Be("A"); response.UserDisplayName.Should().Be("A"); response.UserId.Should().Be(1); }
public virtual PostHistory MapModelToEntity( int id, ApiPostHistoryServerRequestModel model ) { PostHistory item = new PostHistory(); item.SetProperties( id, model.Comment, model.CreationDate, model.PostHistoryTypeId, model.PostId, model.RevisionGUID, model.Text, model.UserDisplayName, model.UserId); return(item); }