Exemple #1
0
        public void CreatePatch()
        {
            var mapper = new ApiCommentsModelMapper();
            var model  = new ApiCommentsRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1, 1, "A", 1);

            JsonPatchDocument <ApiCommentsRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiCommentsRequestModel();

            patch.ApplyTo(response);
            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);
        }