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

            model.SetProperties(true, "A", "A", 1m, 1);

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

            patch.ApplyTo(response);
            response.Active.Should().Be(true);
            response.Description.Should().Be("A");
            response.Name.Should().Be("A");
            response.Price.Should().Be(1m);
            response.Quantity.Should().Be(1);
        }