public void CreatePatch() { var mapper = new ApiPetServerModelMapper(); var model = new ApiPetServerRequestModel(); model.SetProperties(1, 1, "A", 1); JsonPatchDocument <ApiPetServerRequestModel> patch = mapper.CreatePatch(model); var response = new ApiPetServerRequestModel(); patch.ApplyTo(response); response.BreedId.Should().Be(1); response.ClientId.Should().Be(1); response.Name.Should().Be("A"); response.Weight.Should().Be(1); }
public void CreatePatch() { var mapper = new ApiPetServerModelMapper(); var model = new ApiPetServerRequestModel(); model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), 1, "A", 1, 1m); JsonPatchDocument <ApiPetServerRequestModel> patch = mapper.CreatePatch(model); var response = new ApiPetServerRequestModel(); patch.ApplyTo(response); response.AcquiredDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM")); response.BreedId.Should().Be(1); response.Description.Should().Be("A"); response.PenId.Should().Be(1); response.Price.Should().Be(1m); }