public void ApplyTo_InvokedWithInvalidJson_ShouldThrowArgumentException() { // Arrange var invalidJson = "{\"test\":{not valid format}}"; // Act // Assert Assert.Throws <ArgumentException>(() => _patcharpService.ApplyPatchOperation(new Entity(), invalidJson)); }
public void GivenShortEdgeValues_WhenTryingToPatchInt_ThenConvertsSuccessfully(T value) { // Arrange Assume.That(value is short); var json = $"{{\"ValueInt\":\"{value}\"}}"; var entity = new Entity(); // Act _patcharp.ApplyPatchOperation(entity, json); // Assert Assert.That(value, Is.EqualTo(entity.ValueInt)); }