public void MapEntityToModelList() { var mapper = new DALReplyMapper(); Reply item = new Reply(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00")); List <ApiReplyServerResponseModel> response = mapper.MapEntityToModel(new List <Reply>() { { item } }); response.Count.Should().Be(1); }
public void MapModelToEntity() { var mapper = new DALReplyMapper(); ApiReplyServerRequestModel model = new ApiReplyServerRequestModel(); model.SetProperties("A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00")); Reply response = mapper.MapModelToEntity(1, model); response.Content.Should().Be("A"); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ReplierUserId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); }
public void MapEntityToModel() { var mapper = new DALReplyMapper(); Reply item = new Reply(); item.SetProperties(1, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1, TimeSpan.Parse("01:00:00")); ApiReplyServerResponseModel response = mapper.MapEntityToModel(item); response.Content.Should().Be("A"); response.Date.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.ReplierUserId.Should().Be(1); response.ReplyId.Should().Be(1); response.Time.Should().Be(TimeSpan.Parse("01:00:00")); }