-Tests
-XML documentation -Removed generic serialize methods
This commit is contained in:
@@ -318,8 +318,10 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
// Verify contract is properly finding our callback
|
||||
var resolver = new DefaultContractResolver().ResolveContract(typeof(FooEvent));
|
||||
|
||||
#pragma warning disable 612,618
|
||||
Debug.Assert(resolver.OnError != null);
|
||||
Debug.Assert(resolver.OnError == typeof(FooEvent).GetMethod("OnError", BindingFlags.Instance | BindingFlags.NonPublic));
|
||||
#pragma warning restore 612,618
|
||||
|
||||
var serializer = JsonSerializer.Create(new JsonSerializerSettings
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
TypeNameHandling = TypeNameHandling.Auto
|
||||
};
|
||||
var sw = new StringWriter();
|
||||
serializer.Serialize<Person>(new JsonTextWriter(sw) { Formatting = Formatting.Indented }, new WagePerson());
|
||||
serializer.Serialize(new JsonTextWriter(sw) { Formatting = Formatting.Indented }, new WagePerson(), typeof(Person));
|
||||
var result = sw.ToString();
|
||||
|
||||
Assert.AreEqual(@"{
|
||||
@@ -102,7 +102,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
||||
[Test]
|
||||
public void SerializeRootTypeNameAutoWithJsonConvert()
|
||||
{
|
||||
string json = JsonConvert.SerializeObject<object>(new WagePerson(), Formatting.Indented, new JsonSerializerSettings
|
||||
string json = JsonConvert.SerializeObject(new WagePerson(), typeof(object), Formatting.Indented, new JsonSerializerSettings
|
||||
{
|
||||
TypeNameHandling = TypeNameHandling.Auto
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user