public void IfMatchHandlesNullValuesForNonNullable() { // Arrange JsonPatchDocument doc = new JsonPatchDocument(); doc.Add("/Created", null); BugReportPatchVisitor callback = new BugReportPatchVisitor(); // Act + Assert AssertThrows <JsonPatchParserException>(() => doc.Apply(callback)); }
public void CanUseIfMatchInVisitor() { // Arrange JsonPatchDocument doc = new JsonPatchDocument(); doc.Add("/Id", 10); BugReportPatchVisitor callback = new BugReportPatchVisitor(); // Act doc.Apply(callback); // Assert Assert.AreEqual("/Id => 10|", callback.Result); }
public void IfMatchHandlesNullValuesForNullable() { // Arrange JsonPatchDocument doc = new JsonPatchDocument(); doc.Add("/Responsible", null); doc.Add("/Title", null); doc.Add("/LastModified", null); BugReportPatchVisitor callback = new BugReportPatchVisitor(); // Act doc.Apply(callback); // Assert Assert.AreEqual("/Responsible => |/Title => |/LastModified => |", callback.Result); }