Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch: Adds Null support for Set operation #3093

Merged
merged 10 commits into from
Apr 7, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public PatchOperationCore(
this.Path = string.IsNullOrWhiteSpace(path)
? throw new ArgumentNullException(nameof(path))
: path;
this.Value = value ?? throw new ArgumentNullException(nameof(value));
this.Value = value;
}

public override T Value { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public void ConstructPatchOperationTest()
Guid guid = new Guid();
operation = PatchOperation.Set(path, guid);
PatchOperationTests.ValidateOperations(operation, PatchOperationType.Set, guid);

string value = null;
operation = PatchOperation.Set(path, value);
PatchOperationTests.ValidateOperations(operation, PatchOperationType.Set, value);
j82w marked this conversation as resolved.
Show resolved Hide resolved
}

private static void ValidateOperations<T>(PatchOperation patchOperation, PatchOperationType operationType, T value)
Expand Down