Change - Heaps of small changes and bug fixes around LINQ to JSON. Many unit tests added.
Change - CultureInfo is now always passed into FormatWith
This commit is contained in:
@@ -147,6 +147,7 @@ namespace Newtonsoft.Json.Tests
|
||||
}
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class ConverableMembers
|
||||
{
|
||||
public string String = "string";
|
||||
@@ -165,6 +166,31 @@ namespace Newtonsoft.Json.Tests
|
||||
public char Char = '\0';
|
||||
}
|
||||
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class JsonIgnoreAttributeOnClassTestClass
|
||||
{
|
||||
private int _property = 21;
|
||||
private int _ignoredProperty = 12;
|
||||
|
||||
[JsonProperty("TheField")]
|
||||
public int Field;
|
||||
|
||||
[JsonProperty]
|
||||
public int Property
|
||||
{
|
||||
get { return _property; }
|
||||
}
|
||||
|
||||
public int IgnoredField;
|
||||
|
||||
[JsonProperty]
|
||||
[JsonIgnore] // JsonIgnore should take priority
|
||||
public int IgnoredProperty
|
||||
{
|
||||
get { return _ignoredProperty; }
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSerializerTest : TestFixtureBase
|
||||
{
|
||||
[Test]
|
||||
@@ -942,31 +968,6 @@ keyword such as type of business.""
|
||||
Assert.AreEqual(StringComparison.CurrentCultureIgnoreCase, s);
|
||||
}
|
||||
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class JsonIgnoreAttributeOnClassTestClass
|
||||
{
|
||||
private int _property = 21;
|
||||
private int _ignoredProperty = 12;
|
||||
|
||||
[JsonProperty("TheField")]
|
||||
public int Field;
|
||||
|
||||
[JsonProperty]
|
||||
public int Property
|
||||
{
|
||||
get { return _property; }
|
||||
}
|
||||
|
||||
public int IgnoredField;
|
||||
|
||||
[JsonProperty]
|
||||
[JsonIgnore] // JsonIgnore should take priority
|
||||
public int IgnoredProperty
|
||||
{
|
||||
get { return _ignoredProperty; }
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void JsonIgnoreAttributeOnClassTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user