Upgrade test framework versions and fix test issues

This commit is contained in:
Nate McMaster 2017-05-15 16:14:55 -07:00
parent 7a7dc71164
commit a7524e189d
11 changed files with 38 additions and 42 deletions

View File

@ -5,7 +5,7 @@
<JsonNetVersion>10.0.1</JsonNetVersion>
<MoqVersion>4.7.1</MoqVersion>
<NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion>
<TestSdkVersion>15.0.0</TestSdkVersion>
<XunitVersion>2.2.0</XunitVersion>
<TestSdkVersion>15.3.0-*</TestSdkVersion>
<XunitVersion>2.3.0-beta2-*</XunitVersion>
</PropertyGroup>
</Project>

View File

@ -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]

View File

@ -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]

View File

@ -163,7 +163,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Test.Dynamic
var deserialized = JsonConvert.DeserializeObject<JsonPatchDocument>(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<int>() { 1, 2 }, doc.SimpleDTO.IntegerList);
}
}
}
}

View File

@ -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<int>() { 1, 2 }, doc.SimpleDTO.IntegerList);
}
}
}
}

View File

@ -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]

View File

@ -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<JsonPatchDocument>(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<JsonPatchDocument>(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]

View File

@ -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]

View File

@ -18,8 +18,4 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -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<int>() { 1, 2, 3, 5 }, doc.SimpleDTO.IntegerList);
}
}
}
}

View File

@ -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<JsonPatchException>(() => 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);
}
}
}
}