Skip to content

Commit 5ecc686

Browse files
Merge branch 'main' into develop
2 parents 434aa96 + ac4f06d commit 5ecc686

5 files changed

Lines changed: 24 additions & 6 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<DebugType>embedded</DebugType>
1919
</PropertyGroup>
2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
21+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
2222
<PrivateAssets>all</PrivateAssets>
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2424
</PackageReference>

src/Hyperbee.Json/Patch/JsonPatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections;
1+
using System.Collections;
22
using System.Text.Json;
33
using System.Text.Json.Nodes;
44
using System.Text.Json.Serialization;

test/Hyperbee.Json.Benchmark/Hyperbee.Json.Benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

test/Hyperbee.Json.Tests/Hyperbee.Json.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
44
<IsPackable>false</IsPackable>

test/Hyperbee.Json.Tests/Patch/JsonPatchTests.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Text.Json.Nodes;
1+
using System.Text.Json.Nodes;
32
using Hyperbee.Json.Patch;
43
using Microsoft.VisualStudio.TestTools.UnitTesting;
54

@@ -885,6 +884,25 @@ public void Replace_WhenValueProperty()
885884
Assert.AreEqual( "Mark", source!["first"]!.GetValue<string>() );
886885
}
887886

887+
[TestMethod]
888+
public void Replace_WhenValueProperty_WithNull()
889+
{
890+
var source = JsonNode.Parse(
891+
"""
892+
{
893+
"first": "John"
894+
}
895+
""" );
896+
897+
var patch = new JsonPatch(
898+
new PatchOperation( PatchOperationType.Replace, "/first", null, null )
899+
);
900+
901+
patch.Apply( source );
902+
903+
Assert.AreEqual( null, source!["first"] );
904+
}
905+
888906
[TestMethod]
889907
public void Replace_WhenValueObject()
890908
{

0 commit comments

Comments
 (0)