-Formatting

-Build
This commit is contained in:
James Newton-King
2015-12-04 23:54:38 +13:00
parent c96779dc10
commit eb0cbd6a75
334 changed files with 3952 additions and 514 deletions
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Bson
@@ -36,13 +36,15 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
#if !(DNXCORE50 || NET20)
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
{
#region Types
#region Types
public class XmlJsonReader : JsonReader
{
private readonly Stack<JTokenType> _stateStack;
@@ -65,7 +67,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override bool Read()
{
if (HandleValueType())
{
return true;
}
while (_reader.Read())
{
@@ -74,7 +78,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
case XmlNodeType.Element:
string typeName = _reader.GetAttribute("type");
if (typeName == null)
{
throw new Exception("No type specified.");
}
_valueType = (JTokenType)Enum.Parse(typeof(JTokenType), typeName, true);
@@ -100,25 +106,33 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
SetToken(JsonToken.EndObject);
_stateStack.Pop();
if (PeekState() == JTokenType.Property)
{
_stateStack.Pop();
}
return true;
case JTokenType.Array:
SetToken(JsonToken.EndArray);
_stateStack.Pop();
if (PeekState() == JTokenType.Property)
{
_stateStack.Pop();
}
return true;
case JTokenType.Constructor:
SetToken(JsonToken.EndConstructor);
_stateStack.Pop();
if (PeekState() == JTokenType.Property)
{
_stateStack.Pop();
}
return true;
}
_stateStack.Pop();
if (PeekState() == JTokenType.Property)
{
_stateStack.Pop();
}
break;
case XmlNodeType.Text:
@@ -168,7 +182,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
_valueType = null;
if (PeekState() == JTokenType.Property)
{
_stateStack.Pop();
}
return true;
case JTokenType.Object:
SetToken(JsonToken.StartObject);
@@ -183,7 +199,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
case JTokenType.Constructor:
string constructorName = _reader.GetAttribute("name");
if (constructorName == null)
{
throw new Exception("No constructor name specified.");
}
SetToken(JsonToken.StartConstructor, constructorName);
_stateStack.Push(JTokenType.Constructor);
@@ -196,7 +214,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override int? ReadAsInt32()
{
if (!Read())
{
return null;
}
return (Value != null) ? (int?)Convert.ToInt32(Value) : null;
}
@@ -204,7 +224,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override string ReadAsString()
{
if (!Read())
{
return null;
}
return (string)Value;
}
@@ -212,7 +234,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override byte[] ReadAsBytes()
{
if (!Read())
{
return null;
}
return (byte[])Value;
}
@@ -220,7 +244,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override decimal? ReadAsDecimal()
{
if (!Read())
{
return null;
}
return (Value != null) ? (decimal?)Convert.ToDecimal(Value) : null;
}
@@ -228,7 +254,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override DateTime? ReadAsDateTime()
{
if (!Read())
{
return null;
}
return (Value != null) ? (DateTime?)Convert.ToDateTime(Value) : null;
}
@@ -236,12 +264,14 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
public override DateTimeOffset? ReadAsDateTimeOffset()
{
if (!Read())
{
return null;
}
return (Value != null) ? (DateTimeOffset?)Convert.ToDateTime(Value) : null;
}
}
#endregion
#endregion
[TestFixture]
public class CustomJsonReader : TestFixtureBase
@@ -249,7 +279,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
[Test]
public void Example()
{
#region Usage
#region Usage
string xml = @"<Root type=""Object"">
<Null type=""Null"" />
<String type=""String"">This is a string!</String>
@@ -308,7 +338,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
// "Constructor": new Date(2000, 12, 30)
//}
}
#endregion
#endregion
using (XmlReader xmlReader = XmlReader.Create(new StringReader(xml), new XmlReaderSettings { IgnoreWhitespace = true }))
using (XmlJsonReader reader = new XmlJsonReader(xmlReader))
@@ -36,13 +36,15 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
#if !(DNXCORE50 || NET20)
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
{
#region Types
#region Types
public class XmlJsonWriter : JsonWriter
{
private readonly XmlWriter _writer;
@@ -234,9 +236,13 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
base.WriteStartArray();
if (isStart)
{
WriteValueElement("Root", JTokenType.Array);
}
else
{
WriteValueElement(JTokenType.Array);
}
}
public override void WriteStartObject()
@@ -246,9 +252,13 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
base.WriteStartObject();
if (isStart)
{
WriteValueElement("Root", JTokenType.Object);
}
else
{
WriteValueElement(JTokenType.Object);
}
}
public override void WriteStartConstructor(string name)
@@ -258,9 +268,13 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
base.WriteStartConstructor(name);
if (isStart)
{
WriteValueElement("Root", JTokenType.Constructor);
}
else
{
WriteValueElement(JTokenType.Constructor);
}
_writer.WriteAttributeString("name", name);
}
@@ -306,7 +320,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
}
}
}
#endregion
#endregion
[TestFixture]
public class CustomJsonWriter : TestFixtureBase
@@ -314,17 +328,17 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
[Test]
public void Example()
{
#region Usage
#region Usage
var user = new
{
Name = "James",
Age = 30,
Enabled = true,
Roles = new[]
{
"Publisher",
"Administrator"
}
{
"Publisher",
"Administrator"
}
};
StringWriter sw = new StringWriter();
@@ -348,7 +362,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
// <Item type="String">Administrator</Item>
// </Roles>
//</Root>
#endregion
#endregion
sw = new StringWriter();
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
@@ -59,9 +60,13 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
while (reader.Read())
{
if (reader.Value != null)
{
Console.WriteLine("Token: {0}, Value: {1}", reader.TokenType, reader.Value);
}
else
{
Console.WriteLine("Token: {0}", reader.TokenType);
}
}
// Token: StartObject
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
@@ -61,7 +62,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
while (true)
{
if (!reader.Read())
{
break;
}
JsonSerializer serializer = new JsonSerializer();
Role role = serializer.Deserialize<Role>(reader);
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Json
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -62,7 +63,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
{
Console.Write(reader.TokenType);
if (reader.Value != null)
{
Console.Write(" - " + reader.Value);
}
Console.WriteLine();
}
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -41,6 +41,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -59,7 +59,6 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
o["age"] = 59;
o["employer"] = "Bill & Melinda Gates Foundation";
HashSet<string> changedProperties = o.Annotation<HashSet<string>>();
// age
// employer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -30,6 +30,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -40,6 +40,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -41,6 +41,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Linq
@@ -82,4 +82,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -62,4 +62,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -72,4 +72,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -71,4 +71,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -64,4 +64,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -84,4 +84,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -50,4 +50,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -80,4 +80,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -55,4 +55,5 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Schema
}
}
}
#pragma warning restore 618
@@ -38,6 +38,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -38,6 +38,7 @@ using NUnit.Framework;
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
#if !(DNXCORE50 || NET20 || NET35)
@@ -43,7 +44,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
[TestFixture]
public class CustomTraceWriter : TestFixtureBase
{
#region Types
#region Types
public class NLogTraceWriter : ITraceWriter
{
private static readonly Logger Logger = LogManager.GetLogger("NLogTraceWriter");
@@ -84,12 +85,12 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
}
}
}
#endregion
#endregion
[Test]
public void Example()
{
#region Usage
#region Usage
IList<string> countries = new List<string>
{
"New Zealand",
@@ -110,7 +111,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// "Denmark",
// "China"
// ]
#endregion
#endregion
Assert.AreEqual(@"[
""New Zealand"",
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -37,6 +37,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -52,7 +53,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
public Website(Website website)
{
if (website == null)
{
throw new ArgumentNullException("website");
}
Url = website.Url;
}
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -63,7 +63,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
// use Autofac to create types that have been registered with it
if (_container.IsRegistered(objectType))
{
contract.DefaultCreator = () => _container.Resolve(objectType);
}
return contract;
}
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -54,7 +55,9 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
get
{
if (_roles == null)
{
throw new Exception("Roles not loaded!");
}
return _roles;
}
@@ -34,6 +34,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -37,6 +37,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -35,6 +35,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -42,6 +42,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
public class SerializeExtensionData : TestFixtureBase
{
#pragma warning disable 169
#region Types
public class CustomerInvoice
{
@@ -53,6 +54,7 @@ namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
private IDictionary<string, JToken> _additionalData;
}
#endregion
#pragma warning restore 169
[Test]
@@ -32,6 +32,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -33,6 +33,7 @@ using Test = Xunit.FactAttribute;
using Assert = Newtonsoft.Json.Tests.XUnitAssert;
#else
using NUnit.Framework;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer
@@ -40,6 +40,7 @@ using NUnit.Framework;
using Newtonsoft.Json.Utilities.LinqBridge;
#else
using System.Linq;
#endif
namespace Newtonsoft.Json.Tests.Documentation.Samples.Serializer

Some files were not shown because too many files have changed in this diff Show More