public virtual ApiReplyServerRequestModel MapServerResponseToRequest(
            ApiReplyServerResponseModel response)
        {
            var request = new ApiReplyServerRequestModel();

            request.SetProperties(
                response.Content,
                response.Date,
                response.ReplierUserId,
                response.Time);
            return(request);
        }
Example #2
0
        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"));
        }