public virtual ApiCommentsResponseModel MapBOToModel(
            BOComments boComments)
        {
            var model = new ApiCommentsResponseModel();

            model.SetProperties(boComments.Id, boComments.CreationDate, boComments.PostId, boComments.Score, boComments.Text, boComments.UserId);

            return(model);
        }
Esempio n. 2
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiCommentsModelMapper();
            var model  = new ApiCommentsResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, "A", 1);
            ApiCommentsRequestModel response = mapper.MapResponseToRequest(model);

            response.CreationDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.PostId.Should().Be(1);
            response.Score.Should().Be(1);
            response.Text.Should().Be("A");
            response.UserId.Should().Be(1);
        }