diff --git a/build/dependencies.props b/build/dependencies.props index 28b5745a79..3abab6008e 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,7 +5,7 @@ 10.0.1 4.7.1 $(BundledNETStandardPackageVersion) - 15.0.0 - 2.2.0 + 15.3.0-* + 2.3.0-beta2-* diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveOperationTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveOperationTests.cs index ed367848b7..5e2f7ae814 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveOperationTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveOperationTests.cs @@ -98,7 +98,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic deserialized.ApplyTo(doc); Assert.Equal("B", doc.StringProperty); - Assert.Equal(null, doc.SimpleDTO.AnotherStringProperty); + Assert.Null(doc.SimpleDTO.AnotherStringProperty); } [Fact] @@ -121,7 +121,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic deserialized.ApplyTo(doc); Assert.Equal("A", doc.Nested.AnotherStringProperty); - Assert.Equal(null, doc.Nested.StringProperty); + Assert.Null(doc.Nested.StringProperty); } [Fact] diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveTypedOperationTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveTypedOperationTests.cs index cd4124d564..f57ad3d11c 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveTypedOperationTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/MoveTypedOperationTests.cs @@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic deserialized.ApplyTo(doc); Assert.Equal("A", doc.AnotherStringProperty); - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } [Fact] diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveOperationTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveOperationTests.cs index 6e903bf2ec..f0164765ee 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveOperationTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveOperationTests.cs @@ -163,7 +163,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic var deserialized = JsonConvert.DeserializeObject(serialized); deserialized.ApplyTo(doc); - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -184,7 +184,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic deserialized.ApplyTo(doc); - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -299,4 +299,4 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic Assert.Equal(new List() { 1, 2 }, doc.SimpleDTO.IntegerList); } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveTypedOperationTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveTypedOperationTests.cs index 126706eef2..50ae6e8d5d 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveTypedOperationTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/RemoveTypedOperationTests.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic deserialized.ApplyTo(doc); - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } [Fact] @@ -138,7 +138,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic deserialized.ApplyTo(doc); - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -241,4 +241,4 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic Assert.Equal(new List() { 1, 2 }, doc.SimpleDTO.IntegerList); } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceOperationTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceOperationTests.cs index b8e7196068..c5936ec1b0 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceOperationTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceOperationTests.cs @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic Assert.Equal(1, doc.SimpleDTO.DoubleValue); Assert.Equal(0, doc.SimpleDTO.IntegerValue); - Assert.Equal(null, doc.SimpleDTO.IntegerList); + Assert.Null(doc.SimpleDTO.IntegerList); } [Fact] diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceTypedOperationTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceTypedOperationTests.cs index 589e86e03a..d0bf23f487 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceTypedOperationTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Dynamic/ReplaceTypedOperationTests.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic JsonPatchDocument patchDoc = new JsonPatchDocument(); patchDoc.Replace("GuidValue", newGuid); - // serialize & deserialize + // serialize & deserialize var serialized = JsonConvert.SerializeObject(patchDoc); var deserizalized = JsonConvert.DeserializeObject(serialized); @@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic JsonPatchDocument patchDoc = new JsonPatchDocument(); patchDoc.Replace("SimpleDTO", newDTO); - // serialize & deserialize + // serialize & deserialize var serialized = JsonConvert.SerializeObject(patchDoc); var deserialized = JsonConvert.DeserializeObject(serialized); @@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic Assert.Equal(1, doc.SimpleDTO.DoubleValue); Assert.Equal(0, doc.SimpleDTO.IntegerValue); - Assert.Equal(null, doc.SimpleDTO.IntegerList); + Assert.Null(doc.SimpleDTO.IntegerList); } [Fact] diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/JsonPatchDocumentJsonPropertyAttributeTest.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/JsonPatchDocumentJsonPropertyAttributeTest.cs index 182cf1cd6d..efc780b388 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/JsonPatchDocumentJsonPropertyAttributeTest.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/JsonPatchDocumentJsonPropertyAttributeTest.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.JsonPatch // get path var pathToCheck = deserialized.Operations.First().path; - Assert.Equal(pathToCheck, "/anothername"); + Assert.Equal("/anothername", pathToCheck); } [Fact] @@ -82,7 +82,7 @@ namespace Microsoft.AspNetCore.JsonPatch deserialized.ApplyTo(doc); - Assert.Equal(doc.AnotherName, "John"); + Assert.Equal("John", doc.AnotherName); } [Fact] @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.JsonPatch deserialized.ApplyTo(doc); - Assert.Equal(doc.Name, "John"); + Assert.Equal("John", doc.Name); } [Fact] @@ -143,7 +143,7 @@ namespace Microsoft.AspNetCore.JsonPatch deserialized.ApplyTo(doc); - Assert.Equal(null, doc.Name); + Assert.Null(doc.Name); } [Fact] @@ -178,7 +178,7 @@ namespace Microsoft.AspNetCore.JsonPatch // get path var pathToCheck = deserialized.Operations.First().path; - Assert.Equal(pathToCheck, "/anothername"); + Assert.Equal("/anothername", pathToCheck); } [Fact] diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj b/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj index 8f007862cd..29a1f7dbed 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/Microsoft.AspNetCore.JsonPatch.Test.csproj @@ -18,8 +18,4 @@ - - - - diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/NestedObjectTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/NestedObjectTests.cs index ece1a6e3d6..4aa25a3af1 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/NestedObjectTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/NestedObjectTests.cs @@ -597,7 +597,7 @@ namespace Microsoft.AspNetCore.JsonPatch patchDoc.ApplyTo(doc); // Assert - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -623,7 +623,7 @@ namespace Microsoft.AspNetCore.JsonPatch deserialized.ApplyTo(doc); // Assert - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -1796,7 +1796,7 @@ namespace Microsoft.AspNetCore.JsonPatch // Assert Assert.Equal("A", doc.SimpleDTO.AnotherStringProperty); - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -1824,7 +1824,7 @@ namespace Microsoft.AspNetCore.JsonPatch // Assert Assert.Equal("A", doc.SimpleDTO.AnotherStringProperty); - Assert.Equal(null, doc.SimpleDTO.StringProperty); + Assert.Null(doc.SimpleDTO.StringProperty); } [Fact] @@ -1858,7 +1858,7 @@ namespace Microsoft.AspNetCore.JsonPatch Assert.Equal("C", doc.SimpleDTO.StringProperty); Assert.Equal("D", doc.SimpleDTO.AnotherStringProperty); Assert.Same(iDto, doc.SimpleDTO); - Assert.Equal(null, doc.InheritedDTO); + Assert.Null(doc.InheritedDTO); } [Fact] @@ -1895,7 +1895,7 @@ namespace Microsoft.AspNetCore.JsonPatch Assert.Equal("C", doc.SimpleDTO.StringProperty); Assert.Equal("D", doc.SimpleDTO.AnotherStringProperty); Assert.Same(iDto, doc.SimpleDTO); - Assert.Equal(null, doc.InheritedDTO); + Assert.Null(doc.InheritedDTO); } [Fact] @@ -2269,4 +2269,4 @@ namespace Microsoft.AspNetCore.JsonPatch Assert.Equal(new List() { 1, 2, 3, 5 }, doc.SimpleDTO.IntegerList); } } -} \ No newline at end of file +} diff --git a/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs b/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs index d14daadbff..56b25d22be 100644 --- a/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs +++ b/test/Microsoft.AspNetCore.JsonPatch.Test/ObjectAdapterTests.cs @@ -377,7 +377,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters patchDoc.ApplyTo(doc); // Assert - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } [Fact] @@ -400,7 +400,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters deserialized.ApplyTo(doc); // Assert - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } [Fact] @@ -654,7 +654,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters // Arrange var doc = new SimpleDTOWithNullCheck() { - StringProperty = "A", + StringProperty = "A", }; // create patch @@ -720,8 +720,8 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters var serialized = JsonConvert.SerializeObject(patchDoc); // Assert - Assert.Equal(false, serialized.Contains("operations")); - Assert.Equal(false, serialized.Contains("Operations")); + Assert.False(serialized.Contains("operations")); + Assert.False(serialized.Contains("Operations")); } [Fact] @@ -864,7 +864,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters // Assert Assert.Equal(1, doc.SimpleDTO.DoubleValue); Assert.Equal(0, doc.SimpleDTO.IntegerValue); - Assert.Equal(null, doc.SimpleDTO.IntegerList); + Assert.Null(doc.SimpleDTO.IntegerList); } [Fact] @@ -1460,7 +1460,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters // Assert Assert.Equal("A", doc.AnotherStringProperty); - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } [Fact] @@ -1485,7 +1485,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters // Assert Assert.Equal("A", doc.AnotherStringProperty); - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } [Fact] @@ -2283,7 +2283,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters deserialized.ApplyTo(doc); // Assert - Assert.Equal(null, doc.StringProperty); + Assert.Null(doc.StringProperty); } class ClassWithPrivateProperties @@ -2308,8 +2308,8 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters // Act & Assert var exception = Assert.Throws(() => patchDoc.ApplyTo(doc)); Assert.Equal( - string.Format("The target location specified by path segment '{0}' was not found.", "Age"), + string.Format("The target location specified by path segment '{0}' was not found.", "Age"), exception.Message); } } -} \ No newline at end of file +}