Skip to content

Commit

Permalink
-Rename SpecialPropertyHandling to MetadataPropertyHandling
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Apr 27, 2014
1 parent 0eacc35 commit 2039a29
Show file tree
Hide file tree
Showing 28 changed files with 79 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ public void DeserializeExample()
}

[Test]
public void SerializeDeserializeSpecialProperties()
public void SerializeDeserializeMetadataProperties()
{
PreserveReferencesHandlingTests.CircularDictionary circularDictionary = new PreserveReferencesHandlingTests.CircularDictionary();
circularDictionary.Add("other", new PreserveReferencesHandlingTests.CircularDictionary { { "blah", null } });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\JsonSerializerCollectionsTests.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\NullValueHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="TestObjects\Aa.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\JsonSerializerCollectionsTests.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\NullValueHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="TestObjects\Aa.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@
<Compile Include="Serialization\FSharpTests.cs" />
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonSerializerCollectionsTests.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@
<Compile Include="Serialization\FSharpTests.cs" />
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonSerializerCollectionsTests.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@
<Compile Include="Serialization\FSharpTests.cs" />
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonSerializerCollectionsTests.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\ReferenceLoopHandlingTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<Compile Include="Serialization\SerializationErrorHandlingTests.cs" />
<Compile Include="Serialization\SerializationEventAttributeTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\TypeNameHandlingTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Src/Newtonsoft.Json.Tests/Newtonsoft.Json.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
<Compile Include="Serialization\ImmutableCollectionsTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\JsonSerializerTest.cs" />
<Compile Include="Serialization\MetadataPropertyHandlingTests.cs" />
<Compile Include="Serialization\MissingMemberHandlingTests.cs" />
<Compile Include="Serialization\NullValueHandlingTests.cs" />
<Compile Include="Serialization\PopulateTests.cs" />
Expand All @@ -251,7 +252,6 @@
<Compile Include="Serialization\SerializationEventAttributeTests.cs" />
<Compile Include="Serialization\JsonSerializerCollectionsTests.cs" />
<Compile Include="Serialization\ShouldSerializeTests.cs" />
<Compile Include="Serialization\SpecialPropertyHandlingTests.cs" />
<Compile Include="Serialization\TraceWriterTests.cs" />
<Compile Include="Serialization\TypeNameHandlingTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Src/Newtonsoft.Json.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@
// by using the '*' as shown below:

[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.0.2.17226")]
[assembly: AssemblyFileVersion("6.0.3.17227")]
4 changes: 2 additions & 2 deletions Src/Newtonsoft.Json.Tests/Serialization/JsonSerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3407,7 +3407,7 @@ public void DeserializeDictionaryWithNoDefaultConstructor_PreserveReferences()
() => JsonConvert.DeserializeObject<DictionaryWithNoDefaultConstructor>(json, new JsonSerializerSettings
{
PreserveReferencesHandling = PreserveReferencesHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.Default
MetadataPropertyHandling = MetadataPropertyHandling.Default
}));
}

Expand Down Expand Up @@ -4978,7 +4978,7 @@ public void DeserializeMinValueDecimal()
{
var data = new DecimalTest(decimal.MinValue);
var json = JsonConvert.SerializeObject(data);
var obj = JsonConvert.DeserializeObject<DecimalTest>(json, new JsonSerializerSettings { SpecialPropertyHandling = SpecialPropertyHandling.Default });
var obj = JsonConvert.DeserializeObject<DecimalTest>(json, new JsonSerializerSettings { MetadataPropertyHandling = MetadataPropertyHandling.Default });

Assert.AreEqual(decimal.MinValue, obj.Value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
namespace Newtonsoft.Json.Tests.Serialization
{
[TestFixture]
public class SpecialPropertyHandlingTests : TestFixtureBase
public class MetadataPropertyHandlingTests : TestFixtureBase
{
[Test]
public void DeserializeArraysWithPreserveObjectReferences()
Expand Down Expand Up @@ -80,7 +80,7 @@ public void DeserializeArraysWithPreserveObjectReferences()
new JsonSerializerSettings
{
PreserveReferencesHandling = PreserveReferencesHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});
});
}
Expand All @@ -99,7 +99,7 @@ public void SerializeDeserialize_DictionaryContextContainsGuid_DeserializesItemA
{
Formatting = Formatting.Indented,
TypeNameHandling = TypeNameHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
};
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);

Expand Down Expand Up @@ -140,7 +140,7 @@ public void DeserializeGuid()

Item actual = JsonConvert.DeserializeObject<Item>(jsonString, new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});

Assert.AreEqual(new Guid("d8220a4b-75b1-4b7a-8112-b7bdae956a45"), actual.SourceTypeID);
Expand Down Expand Up @@ -182,7 +182,7 @@ public void DeserializeListsWithPreserveObjectReferences()
new JsonSerializerSettings
{
PreserveReferencesHandling = PreserveReferencesHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});

Assert.AreEqual(3, circularList.Count);
Expand Down Expand Up @@ -210,7 +210,7 @@ public void DeserializeTypeNameOnly()
JsonConvert.DeserializeObject(json, null, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Objects,
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});
});
}
Expand All @@ -234,7 +234,7 @@ public void SerializeRefNull()

Dictionary<string, object> result = JsonConvert.DeserializeObject<Dictionary<string, object>>(json, new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});

Assert.AreEqual(3, result.Count);
Expand Down Expand Up @@ -262,7 +262,7 @@ public void DeserializeEmployeeReference()

List<EmployeeReference> employees = JsonConvert.DeserializeObject<List<EmployeeReference>>(json, new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});

Assert.AreEqual(2, employees.Count);
Expand Down Expand Up @@ -294,7 +294,7 @@ public void DeserializeFromJToken()

List<EmployeeReference> employees = t1.ToObject<List<EmployeeReference>>(JsonSerializer.Create(new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
}));

Assert.AreEqual(2, employees.Count);
Expand Down Expand Up @@ -338,7 +338,7 @@ public void DeserializeGenericObjectListWithTypeName()
{
TypeNameHandling = TypeNameHandling.Objects,
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full,
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});

Assert.AreEqual(4, values.Count);
Expand Down Expand Up @@ -386,7 +386,7 @@ public void WriteListTypeNameForProperty()

TypeNameHandlingTests.TypeNameProperty deserialized = JsonConvert.DeserializeObject<TypeNameHandlingTests.TypeNameProperty>(json, new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.ReadAhead
MetadataPropertyHandling = MetadataPropertyHandling.ReadAhead
});
Assert.AreEqual("Name!", deserialized.Name);
CustomAssert.IsInstanceOfType(typeof(List<int>), deserialized.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void UnexpectedEnd()
new JsonSerializerSettings
{
PreserveReferencesHandling = PreserveReferencesHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.Default
MetadataPropertyHandling = MetadataPropertyHandling.Default
});
});
}
Expand Down Expand Up @@ -1069,7 +1069,7 @@ public void DuplicateId()
"Error reading object reference '1'. Path 'Data.Prop2.MyProperty', line 9, position 20.",
() => JsonConvert.DeserializeObject<PropertyItemIsReferenceObject>(json, new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.Default
MetadataPropertyHandling = MetadataPropertyHandling.Default
}));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public void MultipleRequiredPropertyErrors()
string json = "{}";
List<string> errors = new List<string>();
JsonSerializer serializer = new JsonSerializer();
serializer.SpecialPropertyHandling = SpecialPropertyHandling.Default;
serializer.MetadataPropertyHandling = MetadataPropertyHandling.Default;
serializer.Error += delegate(object sender, ErrorEventArgs args)
{
errors.Add(args.ErrorContext.Path + " - " + args.ErrorContext.Member + " - " + args.ErrorContext.Error.Message);
Expand Down Expand Up @@ -540,7 +540,7 @@ public void InfiniteLoopArrayHandlingInObject()
"{'badarray':[0,x,2],'goodarray':[0,1,2]}",
new JsonSerializerSettings
{
SpecialPropertyHandling = SpecialPropertyHandling.Default,
MetadataPropertyHandling = MetadataPropertyHandling.Default,
Error = (sender, arg) =>
{
errors.Add(arg.ErrorContext.Error.Message);
Expand Down Expand Up @@ -570,7 +570,7 @@ public void ErrorHandlingEndOfContent()
JsonSerializer jsonSerializer = JsonSerializer.Create(new JsonSerializerSettings
{
MaxDepth = maxDepth,
SpecialPropertyHandling = SpecialPropertyHandling.Default
MetadataPropertyHandling = MetadataPropertyHandling.Default
});
jsonSerializer.Error += (sender, e) =>
{
Expand Down Expand Up @@ -601,7 +601,7 @@ public void ErrorHandlingEndOfContentDictionary()
const int maxDepth = 256;
using (var jsonTextReader = new JsonTextReader(new StringReader(input)) { MaxDepth = maxDepth })
{
JsonSerializer jsonSerializer = JsonSerializer.Create(new JsonSerializerSettings { MaxDepth = maxDepth, SpecialPropertyHandling = SpecialPropertyHandling.Default });
JsonSerializer jsonSerializer = JsonSerializer.Create(new JsonSerializerSettings { MaxDepth = maxDepth, MetadataPropertyHandling = MetadataPropertyHandling.Default });
jsonSerializer.Error += (sender, e) =>
{
errors.Add(e.ErrorContext.Error.Message);
Expand Down Expand Up @@ -641,7 +641,7 @@ public void ErrorHandlingEndOfContentDynamic()
errors.Add(e.ErrorContext.Error.Message);
e.ErrorContext.Handled = true;
},
SpecialPropertyHandling = SpecialPropertyHandling.Default
MetadataPropertyHandling = MetadataPropertyHandling.Default
});
Assert.AreEqual(true, newDynamicObject.Explicit);

Expand Down
6 changes: 3 additions & 3 deletions Src/Newtonsoft.Json.Tests/Serialization/TraceWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void MemoryTraceWriterDeserializeTest()
{
TraceWriter = traceWriter,
Converters = { new JavaScriptDateTimeConverter() },
SpecialPropertyHandling = SpecialPropertyHandling.Default
MetadataPropertyHandling = MetadataPropertyHandling.Default
});

Console.WriteLine(traceWriter);
Expand Down Expand Up @@ -403,7 +403,7 @@ public void DeserializeDictionarysWithPreserveObjectReferences()
new JsonSerializerSettings
{
PreserveReferencesHandling = PreserveReferencesHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.Default,
MetadataPropertyHandling = MetadataPropertyHandling.Default,
TraceWriter = traceWriter
});

Expand Down Expand Up @@ -523,7 +523,7 @@ public void DeserializeTypeName()
JsonConvert.DeserializeObject(json, null, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.All,
SpecialPropertyHandling = SpecialPropertyHandling.Default,
MetadataPropertyHandling = MetadataPropertyHandling.Default,
TraceWriter = traceWriter
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void NestedValueObjects()
{
var reader = new JsonTextReader(new StringReader(sb.ToString()));
var ser = new JsonSerializer();
ser.SpecialPropertyHandling = SpecialPropertyHandling.Default;
ser.MetadataPropertyHandling = MetadataPropertyHandling.Default;
ser.Deserialize<bool>(reader);
});
}
Expand Down
Loading

0 comments on commit 2039a29

Please sign in to comment.