-Added Portable Class Library build

This commit is contained in:
James Newton-King
2012-04-18 21:02:34 +12:00
parent 6725edb75c
commit 10256fcf68
85 changed files with 1005 additions and 344 deletions
@@ -29,7 +29,7 @@ namespace Newtonsoft.Json.Tests.Converters
public byte[] NullByteArray { get; set; }
}
#if !SILVERLIGHT && !PocketPC && !NET20 && !NETFX_CORE
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE)
[Test]
public void DeserializeBinaryClass()
{
@@ -87,7 +87,7 @@ namespace Newtonsoft.Json.Tests.Converters
byteArrayClass.ByteArray = TestData;
byteArrayClass.NullByteArray = null;
string json = JsonConvert.SerializeObject(byteArrayClass, Formatting.Indented, new BinaryConverter());
string json = JsonConvert.SerializeObject(byteArrayClass, Formatting.Indented);
Assert.AreEqual(@"{
""ByteArray"": ""VGhpcyBpcyBzb21lIHRlc3QgZGF0YSEhIQ=="",
@@ -95,7 +95,7 @@ namespace Newtonsoft.Json.Tests.Converters
}", json);
}
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
public class SqlBinaryClass
{
public SqlBinary SqlBinary { get; set; }
@@ -145,7 +145,7 @@ namespace Newtonsoft.Json.Tests.Converters
""NullByteArray"": null
}";
ByteArrayClass byteArrayClass = JsonConvert.DeserializeObject<ByteArrayClass>(json, new BinaryConverter());
ByteArrayClass byteArrayClass = JsonConvert.DeserializeObject<ByteArrayClass>(json);
CollectionAssert.AreEquivalent(TestData, byteArrayClass.ByteArray);
Assert.AreEqual(null, byteArrayClass.NullByteArray);
@@ -1,4 +1,4 @@
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
using System;
using Newtonsoft.Json.Converters;
#if !NETFX_CORE
@@ -1,4 +1,4 @@
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
using System;
#if !NETFX_CORE
using NUnit.Framework;
@@ -1,4 +1,4 @@
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
using System;
using System.Collections.Generic;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Tests.Serialization;
+2 -2
View File
@@ -285,7 +285,7 @@ now brown cow?", '"', true);
value = null;
Assert.AreEqual("null", JsonConvert.ToString(value));
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
value = DBNull.Value;
Assert.AreEqual("null", JsonConvert.ToString(value));
#endif
@@ -679,7 +679,7 @@ now brown cow?", '"', true);
return (T)converter.ReadJson(reader, typeof(T), null, null);
}
#if !(NET20 || NET35 || SILVERLIGHT)
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
[Test]
public void Async()
{
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !PocketPC && !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
using NUnit.Framework;
using System.Web.UI;
using Newtonsoft.Json.Linq;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
using NUnit.Framework;
using Newtonsoft.Json.Linq;
@@ -1,4 +1,4 @@
#if !(NET35 || NET20)
#if !(NET35 || NET20 || PORTABLE)
using System;
using System.Collections.Generic;
using System.Dynamic;
@@ -424,7 +424,7 @@ Parameter name: index"
}
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void ITypedListGetItemProperties()
{
@@ -648,7 +648,7 @@ Parameter name: arrayIndex"
Assert.AreEqual(p4, l[1]);
}
#if !PocketPC && !SILVERLIGHT && !NET20 && !NETFX_CORE
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE)
[Test]
public void PropertyChanging()
{
@@ -1205,7 +1205,7 @@ Parameter name: arrayIndex"
});
}
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void IBindingListSortDirection()
{
@@ -1391,7 +1391,7 @@ Parameter name: arrayIndex"
Assert.AreEqual(2, (int)o["Test1"]);
}
#endif
#if SILVERLIGHT || !(NET20 || NET35)
#if SILVERLIGHT || !(NET20 || NET35 || PORTABLE)
[Test]
public void CollectionChanged()
{
@@ -1521,7 +1521,7 @@ Parameter name: arrayIndex"
Assert.AreEqual("Name2", value);
}
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
[Test]
public void WriteObjectNullDBNullValue()
{
@@ -1652,7 +1652,7 @@ Parameter name: arrayIndex"
});
}
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void GetProperties()
{
@@ -31,7 +31,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual(p, p.Value.Parent);
}
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void ListChanged()
{
@@ -708,7 +708,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.IsTrue(a.DeepEquals(a2));
}
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void Clone()
{
@@ -69,7 +69,7 @@ namespace Newtonsoft.Json.Tests.Linq
Assert.AreEqual("Pie", v.Value);
Assert.AreEqual(JTokenType.String, v.Type);
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
v.Value = DBNull.Value;
Assert.AreEqual(DBNull.Value, v.Value);
Assert.AreEqual(JTokenType.Null, v.Type);
@@ -719,7 +719,7 @@ keyword such as type of business.""
Assert.AreEqual(new DateTime(2000, 10, 15, 5, 5, 5, DateTimeKind.Utc), d);
}
#if !(NET20 || NET35 || SILVERLIGHT)
#if !(NET20 || NET35 || SILVERLIGHT || PORTABLE)
[Test]
public void CovariantIJEnumerable()
{
@@ -0,0 +1,326 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3E6E2335-B079-4B5B-A65A-9D586914BCBB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Newtonsoft.Json.Tests</RootNamespace>
<AssemblyName>Newtonsoft.Json.Tests</AssemblyName>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\Portable\</OutputPath>
<DefineConstants>TRACE;DEBUG;PORTABLE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\Portable\</OutputPath>
<DefineConstants>TRACE;PORTABLE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\NUnit\DotNet\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.Entity">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.ServiceModel.Web">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Bson\BsonWriterTests.cs" />
<Compile Include="Bson\BsonReaderTests.cs" />
<Compile Include="Converters\BinaryConverterTests.cs" />
<Compile Include="Converters\ExpandoObjectConverterTests.cs" />
<Compile Include="Converters\RegexConverterTests.cs" />
<Compile Include="Converters\DataTableConverterTests.cs" />
<Compile Include="Converters\DataSetConverterTests.cs" />
<Compile Include="Converters\CustomCreationConverterTests.cs" />
<Compile Include="Converters\ObjectIdConverterTests.cs" />
<Compile Include="Converters\StringEnumConverterTests.cs" />
<Compile Include="Converters\VersionConverterTests.cs" />
<Compile Include="FileSystemEntityModel.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>FileSystemEntityModel.edmx</DependentUpon>
</Compile>
<Compile Include="JsonArrayAttributeTests.cs" />
<Compile Include="ExceptionTests.cs" />
<Compile Include="JsonValidatingReaderTests.cs" />
<Compile Include="Linq\ComponentModel\BindingTests.cs" />
<Compile Include="Linq\ComponentModel\JPropertyDescriptorTests.cs" />
<Compile Include="Linq\DynamicTests.cs" />
<Compile Include="Linq\JPathTests.cs" />
<Compile Include="Linq\JRawTests.cs" />
<Compile Include="Serialization\ConstructorHandlingTests.cs" />
<Compile Include="Serialization\ContractResolverTests.cs" />
<Compile Include="Serialization\DefaultValueHandlingTests.cs" />
<Compile Include="Serialization\DynamicTests.cs" />
<Compile Include="Serialization\WebApiIntegrationTests.cs" />
<Compile Include="Serialization\JsonPropertyCollectionTests.cs" />
<Compile Include="Serialization\NullValueHandlingTests.cs" />
<Compile Include="TestObjects\Bar.cs" />
<Compile Include="TestObjects\Car.cs" />
<Compile Include="TestObjects\Computer.cs" />
<Compile Include="TestObjects\ConstructorReadonlyFields.cs" />
<Compile Include="TestObjects\Container.cs" />
<Compile Include="TestObjects\ContentBaseClass.cs" />
<Compile Include="TestObjects\ContentSubClass.cs" />
<Compile Include="TestObjects\Foo.cs" />
<Compile Include="TestObjects\HolderClass.cs" />
<Compile Include="TestObjects\IPrivateImplementationA.cs" />
<Compile Include="TestObjects\IPrivateImplementationB.cs" />
<Compile Include="TestObjects\IPrivateOverriddenImplementation.cs" />
<Compile Include="TestObjects\ListOfIds.cs" />
<Compile Include="TestObjects\Movie.cs" />
<Compile Include="TestObjects\PersonError.cs" />
<Compile Include="TestObjects\PersonPropertyClass.cs" />
<Compile Include="TestObjects\PrivateConstructorTestClass.cs" />
<Compile Include="TestObjects\PrivateConstructorWithPublicParametizedConstructorTestClass.cs" />
<Compile Include="TestObjects\Content.cs" />
<Compile Include="TestObjects\DateTimeErrorObjectCollection.cs" />
<Compile Include="Serialization\EntitiesSerializationTests.cs" />
<Compile Include="TestObjects\DictionaryInterfaceClass.cs" />
<Compile Include="TestObjects\Event.cs" />
<Compile Include="TestObjects\GoogleMapGeocoderStructure.cs" />
<Compile Include="TestObjects\InterfacePropertyTestClass.cs" />
<Compile Include="TestObjects\JsonPropertyClass.cs" />
<Compile Include="TestObjects\ListErrorObject.cs" />
<Compile Include="TestObjects\ListErrorObjectCollection.cs" />
<Compile Include="Serialization\MissingMemberHandlingTests.cs" />
<Compile Include="Serialization\PopulateTests.cs" />
<Compile Include="Serialization\SerializationErrorHandlingTests.cs" />
<Compile Include="Serialization\SerializationEventAttributeTests.cs" />
<Compile Include="Schema\ExtensionsTests.cs" />
<Compile Include="Schema\JsonSchemaModelBuilderTests.cs" />
<Compile Include="Schema\JsonSchemaNodeTests.cs" />
<Compile Include="Serialization\CamelCasePropertyNamesContractResolverTests.cs" />
<Compile Include="Serialization\PreserveReferencesHandlingTests.cs" />
<Compile Include="Serialization\TypeNameHandlingTests.cs" />
<Compile Include="TestObjects\ListTestClass.cs" />
<Compile Include="TestObjects\LogEntry.cs" />
<Compile Include="TestObjects\NonRequest.cs" />
<Compile Include="TestObjects\ObjectArrayPropertyTest.cs" />
<Compile Include="TestObjects\PrivateImplementationAClass.cs" />
<Compile Include="TestObjects\PrivateImplementationBClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorRequiringConverterTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorWithNonPropertyParameterTestClass.cs" />
<Compile Include="TestObjects\PublicParametizedConstructorWithPropertyNameConflict.cs" />
<Compile Include="TestObjects\SearchResult.cs" />
<Compile Include="TestObjects\StructTest.cs" />
<Compile Include="TestObjects\WagePerson.cs" />
<Compile Include="TestObjects\PropertyCase.cs" />
<Compile Include="TestObjects\RequestOnly.cs" />
<Compile Include="TestObjects\RoleTransfer.cs" />
<Compile Include="TestObjects\SetOnlyPropertyClass2.cs" />
<Compile Include="TestObjects\SubKlass.cs" />
<Compile Include="TestObjects\SuperKlass.cs" />
<Compile Include="TestObjects\VersionKeyedCollection.cs" />
<Compile Include="TestObjects\AbstractGenericBase.cs" />
<Compile Include="TestObjects\ArgumentConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\BadJsonPropertyClass.cs" />
<Compile Include="TestObjects\CircularReferenceClass.cs" />
<Compile Include="TestObjects\ClassAndMemberConverterClass.cs" />
<Compile Include="TestObjects\ClassConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\ConstructorCaseSensitivityClass.cs" />
<Compile Include="TestObjects\ConverterPrecedenceClass.cs" />
<Compile Include="TestObjects\ConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\CircularReferenceWithIdClass.cs" />
<Compile Include="TestObjects\EmployeeReference.cs" />
<Compile Include="TestObjects\JsonPropertyWithHandlingValues.cs" />
<Compile Include="TestObjects\DefaultValueAttributeTestClass.cs" />
<Compile Include="TestObjects\DoubleClass.cs" />
<Compile Include="TestObjects\GenericImpl.cs" />
<Compile Include="TestObjects\GenericListAndDictionaryInterfaceProperties.cs" />
<Compile Include="TestObjects\GetOnlyPropertyClass.cs" />
<Compile Include="TestObjects\IncompatibleJsonAttributeClass.cs" />
<Compile Include="TestObjects\Invoice.cs" />
<Compile Include="TestObjects\JsonIgnoreAttributeTestClass.cs" />
<Compile Include="TestObjects\MemberConverterPrecedenceClassConverter.cs" />
<Compile Include="TestObjects\MethodExecutorObject.cs" />
<Compile Include="TestObjects\JaggedArray.cs" />
<Compile Include="TestObjects\MyClass.cs" />
<Compile Include="TestObjects\Name.cs" />
<Compile Include="TestObjects\PersonRaw.cs" />
<Compile Include="TestObjects\PhoneNumber.cs" />
<Compile Include="TestObjects\PrivateMembersClass.cs" />
<Compile Include="TestObjects\RequiredMembersClass.cs" />
<Compile Include="TestObjects\SerializationEventTestDictionary.cs" />
<Compile Include="TestObjects\SerializationEventTestList.cs" />
<Compile Include="TestObjects\SerializationEventTestObject.cs" />
<Compile Include="TestObjects\SerializationEventTestObjectWithConstructor.cs" />
<Compile Include="TestObjects\SetOnlyPropertyClass.cs" />
<Compile Include="TestObjects\Article.cs" />
<Compile Include="TestObjects\ArticleCollection.cs" />
<Compile Include="TestObjects\ClassWithArray.cs" />
<Compile Include="TestObjects\ClassWithGuid.cs" />
<Compile Include="TestObjects\ConverableMembers.cs" />
<Compile Include="TestObjects\JsonIgnoreAttributeOnClassTestClass.cs" />
<Compile Include="Linq\JConstructorTests.cs" />
<Compile Include="Linq\JPropertyTests.cs" />
<Compile Include="TestObjects\MemberConverterClass.cs" />
<Compile Include="TestObjects\Product.cs" />
<Compile Include="TestObjects\ProductCollection.cs" />
<Compile Include="TestObjects\ProductShort.cs" />
<Compile Include="TestObjects\Shortie.cs" />
<Compile Include="TestObjects\Store.cs" />
<Compile Include="TestObjects\StoreColor.cs" />
<Compile Include="TestObjects\Person.cs" />
<Compile Include="Schema\JsonSchemaBuilderTests.cs" />
<Compile Include="Schema\JsonSchemaGeneratorTests.cs" />
<Compile Include="Schema\JsonSchemaTests.cs" />
<Compile Include="TestObjects\NullableDateTimeTestClass.cs" />
<Compile Include="TestObjects\DateTimeTestClass.cs" />
<Compile Include="Converters\IsoDateTimeConverterTests.cs" />
<Compile Include="JsonConvertTest.cs" />
<Compile Include="Converters\JavaScriptDateTimeConverterTests.cs" />
<Compile Include="Serialization\JsonSerializerTest.cs" />
<Compile Include="JsonTextReaderTest.cs" />
<Compile Include="JsonTextWriterTest.cs" />
<Compile Include="Linq\JTokenReaderTest.cs" />
<Compile Include="Linq\JTokenWriterTest.cs" />
<Compile Include="Linq\JArrayTests.cs" />
<Compile Include="Linq\JObjectTests.cs" />
<Compile Include="Linq\JTokenEqualityComparerTests.cs" />
<Compile Include="Linq\JTokenTests.cs" />
<Compile Include="Linq\JValueTests.cs" />
<Compile Include="Linq\LinqToJsonTest.cs" />
<Compile Include="PerformanceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SilverlightTests.cs" />
<Compile Include="TestFixtureBase.cs" />
<Compile Include="Converters\XmlNodeConverterTest.cs" />
<Compile Include="TestObjects\TypeClass.cs" />
<Compile Include="TestObjects\TypedSubHashtable.cs" />
<Compile Include="TestObjects\UserNullable.cs" />
<Compile Include="Utilities\DynamicReflectionDelegateFactoryTests.cs" />
<Compile Include="Utilities\ReflectionUtilsTests.cs" />
</ItemGroup>
<ItemGroup>
<Service Include="{3259AA49-8AA1-44D3-9025-A0B520596A8C}" />
</ItemGroup>
<ItemGroup>
<EntityDeploy Include="FileSystemEntityModel.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>FileSystemEntityModel.Designer.cs</LastGenOutput>
</EntityDeploy>
</ItemGroup>
<ItemGroup>
<Content Include="bunny_pancake.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="PoisonText.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Newtonsoft.Json\Newtonsoft.Json.Portable.csproj">
<Project>{959F7F85-C98B-4876-971A-9036224578E4}</Project>
<Name>Newtonsoft.Json.Portable</Name>
<Aliases>global,NewtonsoftJson</Aliases>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,4 +1,4 @@
#if !SILVERLIGHT && !PocketPC && !NET20 && !NET35 && !NETFX_CORE
#if !(SILVERLIGHT || PocketPC || NET20 || NET35 || NETFX_CORE || PORTABLE)
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -40,8 +40,8 @@ namespace Newtonsoft.Json.Tests
[TestFixture]
public class PerformanceTests : TestFixtureBase
{
//private const int Iterations = 100;
private const int Iterations = 5000;
private const int Iterations = 100;
//private const int Iterations = 5000;
#region Data
@@ -72,5 +72,5 @@ using System.Security;
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.5.0.0")]
#if !PocketPC
[assembly: AssemblyFileVersion("4.5.3.14817")]
[assembly: AssemblyFileVersion("4.5.3.14818")]
#endif
@@ -202,7 +202,7 @@ namespace Newtonsoft.Json.Tests.Schema
#if !NET20 && !PocketPC
GenerateSchemaAndSerializeFromType(new NullableDateTimeTestClass());
#endif
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
GenerateSchemaAndSerializeFromType(new DataSet());
#endif
GenerateSchemaAndSerializeFromType(new object());
@@ -210,7 +210,7 @@ namespace Newtonsoft.Json.Tests.Schema
GenerateSchemaAndSerializeFromType("Hi");
GenerateSchemaAndSerializeFromType(new DateTime(2000, 12, 29, 23, 59, 0, DateTimeKind.Utc));
GenerateSchemaAndSerializeFromType(TimeSpan.FromTicks(1000000));
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
GenerateSchemaAndSerializeFromType(DBNull.Value);
#endif
GenerateSchemaAndSerializeFromType(new JsonPropertyWithHandlingValues());
@@ -90,7 +90,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(o.IsValid(schema));
}
#if !PocketPC && !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
[Test]
public void Generate_DefaultValueAttributeTestClass()
{
@@ -310,7 +310,7 @@ namespace Newtonsoft.Json.Tests.Schema
Assert.IsTrue(v.IsValid(schema));
}
#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void GenerateSchemaForISerializable()
{
@@ -325,7 +325,7 @@ namespace Newtonsoft.Json.Tests.Schema
}
#endif
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
[Test]
public void GenerateSchemaForDBNull()
{
@@ -370,7 +370,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CustomDirectoryInfoMapper
{
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
};
@@ -454,7 +454,7 @@ namespace Newtonsoft.Json.Tests.Schema
serializer.Converters.Add(new IsoDateTimeConverter());
serializer.ContractResolver = new CustomDirectoryInfoMapper
{
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableInterface = true
#endif
};
@@ -474,7 +474,7 @@ namespace Newtonsoft.Json.Tests.Schema
generator.UndefinedSchemaIdHandling = UndefinedSchemaIdHandling.UseTypeName;
generator.ContractResolver = new CamelCasePropertyNamesContractResolver()
{
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
};
@@ -519,7 +519,7 @@ namespace Newtonsoft.Json.Tests.Schema
}", json);
}
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void GenerateSchemaSerializable()
{
@@ -177,7 +177,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}", json);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
[Test]
public void DynamicCamelCasePropertyNames()
{
@@ -1,4 +1,4 @@
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
using System;
using System.Collections;
using System.Collections.Generic;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !(NET35 || NET20 || SILVERLIGHT || NETFX_CORE)
#if !(NET35 || NET20 || SILVERLIGHT || NETFX_CORE || PORTABLE)
using System;
using System.Collections.Generic;
using System.Data;
@@ -688,7 +688,7 @@ keyword such as type of business.""
string json = JsonConvert.SerializeObject(new ConverableMembers(), Formatting.Indented);
string expected = null;
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
expected = @"{
""String"": ""string"",
""Int32"": 2147483647,
@@ -728,7 +728,7 @@ keyword such as type of business.""
ConverableMembers c = JsonConvert.DeserializeObject<ConverableMembers>(json);
Assert.AreEqual("string", c.String);
Assert.AreEqual(double.MaxValue, c.Double);
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
Assert.AreEqual(DBNull.Value, c.DBNull);
#endif
}
@@ -1471,7 +1471,7 @@ keyword such as type of business.""
Assert.AreEqual("titleId", n.FidOrder[n.FidOrder.Count - 1]);
}
#if !SILVERLIGHT && !PocketPC && !NET20 && !NETFX_CORE
#if !(SILVERLIGHT || NET20 || NETFX_CORE || PORTABLE)
[MetadataType(typeof (OptInClassMetadata))]
public class OptInClass
{
@@ -2036,7 +2036,7 @@ To force JSON objects to deserialize add the JsonObjectAttribute to the type. Li
{
ContractResolver = new DefaultContractResolver
{
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
}
@@ -2054,11 +2054,11 @@ To force JSON objects to deserialize add the JsonObjectAttribute to the type. Li
JsonConvert.DeserializeObject<MemoryStream>("{ReadTimeout:0}", new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver
{
#if !(SILVERLIGHT || NETFX_CORE)
{
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
}
}
});
}
@@ -2073,11 +2073,11 @@ To force JSON objects to deserialize add the JsonObjectAttribute to the type. Li
JsonConvert.DeserializeObject<MemoryStream>("{ReadTimeout:''}", new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver
{
#if !(SILVERLIGHT || NETFX_CORE)
{
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
}
}
});
}
@@ -2092,11 +2092,11 @@ To force JSON objects to deserialize add the JsonObjectAttribute to the type. Li
JsonConvert.DeserializeObject<MemoryStream>("{ReadTimeout:null}", new JsonSerializerSettings
{
ContractResolver = new DefaultContractResolver
{
#if !(SILVERLIGHT || NETFX_CORE)
{
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
}
}
});
}
@@ -2751,7 +2751,7 @@ To force JSON objects to deserialize add the JsonObjectAttribute to the type. Li
Assert.AreEqual("value", newModelStateDictionary["key"]);
}
#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
public class ISerializableTestObject : ISerializable
{
internal string _stringValue;
@@ -3243,7 +3243,7 @@ To fix this error either change the environment to be fully trusted, change the
}
#endif
#if !NET20 && !SILVERLIGHT
#if !(NET20 || SILVERLIGHT || PORTABLE)
[Test]
public void SerializeDeserializeXNodeProperties()
{
@@ -3274,7 +3274,7 @@ To fix this error either change the environment to be fully trusted, change the
}
#endif
#if !SILVERLIGHT && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void SerializeDeserializeXmlNodeProperties()
{
@@ -4150,7 +4150,7 @@ To fix this error either change the environment to be fully trusted, change the
}", json);
}
#if !(NET35 || NET20 || WINDOWS_PHONE)
#if !(NET35 || NET20 || WINDOWS_PHONE || PORTABLE)
[Test]
public void SerializeExpandoObject()
{
@@ -5118,7 +5118,7 @@ To fix this error either change the environment to be fully trusted, change the
}
}
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE)
#if !(SILVERLIGHT || WINDOWS_PHONE || NETFX_CORE || PORTABLE)
[Test]
public void SerializeException1()
{
@@ -5248,7 +5248,7 @@ To fix this error either change the environment to be fully trusted, change the
}
}
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE)
#if !(NET35 || NET20 || SILVERLIGHT || WINDOWS_PHONE || PORTABLE)
[Test]
public void DeserializeConcurrentDictionary()
{
@@ -5845,7 +5845,7 @@ Parameter name: value"
Converters = { new MetroStringConverter() },
Formatting = Formatting.Indented
});
Assert.AreEqual(metroJson, @"{
Assert.AreEqual(@"{
"":::NAME:::"": "":::APPLE:::"",
"":::EXPIRYDATE:::"": ""2012-04-01T00:00:00"",
"":::PRICE:::"": 3.99,
@@ -5854,7 +5854,7 @@ Parameter name: value"
"":::MEDIUM:::"",
"":::LARGE:::""
]
}");
}", metroJson);
//{
// ":::NAME:::": ":::APPLE:::",
// ":::EXPIRYDATE:::": "2012-04-01T00:00:00",
@@ -5864,11 +5864,6 @@ Parameter name: value"
Color[] colors = new []{ Color.Blue, Color.Red, Color.Yellow, Color.Green, Color.Black, Color.Brown };
string json1 = JsonConvert.SerializeObject(colors);
//[":::GRAY:::", ":::GRAY:::", ":::GRAY:::", ":::GRAY:::", ":::BLACK:::", ":::GRAY:::"]
Assert.AreEqual(json1, @"[""Blue"",""Red"",""Yellow"",""Green"",""Black"",""Brown""]");
string json2 = JsonConvert.SerializeObject(colors, new JsonSerializerSettings
{
ContractResolver = new MetroPropertyNameResolver(),
@@ -5876,14 +5871,14 @@ Parameter name: value"
Formatting = Formatting.Indented
});
Assert.AreEqual(json2, @"[
Assert.AreEqual(@"[
"":::GRAY:::"",
"":::GRAY:::"",
"":::GRAY:::"",
"":::GRAY:::"",
"":::BLACK:::"",
"":::GRAY:::""
]");
]", json2);
}
public class MetroStringConverter : JsonConverter
@@ -5933,6 +5928,32 @@ Parameter name: value"
}
}
#endif
private class FooBar
{
public DateTimeOffset Foo { get; set; }
}
[Test]
public void TokenFromBson()
{
MemoryStream ms = new MemoryStream();
BsonWriter writer = new BsonWriter(ms);
writer.WriteStartArray();
writer.WriteValue("2000-01-02T03:04:05+06:00");
writer.WriteEndArray();
byte[] data = ms.ToArray();
BsonReader reader = new BsonReader(new MemoryStream(data))
{
ReadRootValueAsArray = true
};
JArray a = (JArray)JArray.ReadFrom(reader);
JValue v = (JValue)a[0];
Console.WriteLine(v.Value.GetType());
Console.WriteLine(a.ToString());
}
}
public class PersonWithPrivateConstructor
@@ -23,6 +23,10 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if PORTABLE
extern alias NewtonsoftJson;
using FormatterAssemblyStyle = NewtonsoftJson::System.Runtime.Serialization.Formatters.FormatterAssemblyStyle;
#endif
using System;
using System.Collections;
using System.Collections.Generic;
@@ -135,7 +139,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual("Name!", ((EmployeeReference)employee).Name);
}
#if !SILVERLIGHT && !PocketPC && !NETFX_CORE
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void DeserializeTypeNameFromGacAssembly()
{
@@ -969,7 +973,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Binder = new MetroBinder(),
ContractResolver = new DefaultContractResolver
{
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = true
#endif
}
@@ -34,7 +34,7 @@ namespace Newtonsoft.Json.Tests.Serialization
nonSerializedField = "Error"
};
#if !(SILVERLIGHT || NETFX_CORE || NET20)
#if !(SILVERLIGHT || NETFX_CORE || NET20 || PORTABLE)
MemoryStream ms = new MemoryStream();
DataContractJsonSerializer dataContractJsonSerializer = new DataContractJsonSerializer(typeof(SerializableType));
dataContractJsonSerializer.WriteObject(ms, serializableType);
@@ -50,7 +50,7 @@ namespace Newtonsoft.Json.Tests.Serialization
{
ContractResolver = new DefaultContractResolver
{
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
IgnoreSerializableAttribute = false
#endif
}
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Serialization
Assert.AreEqual(expected, json);
}
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Test]
public void SerializeInheritedType()
{
@@ -89,7 +89,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
}
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[Serializable]
#else
[JsonObject(MemberSerialization.Fields)]
@@ -119,7 +119,7 @@ namespace Newtonsoft.Json.Tests.Serialization
}
}
#if !(SILVERLIGHT || NETFX_CORE)
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[NonSerialized]
#else
[JsonIgnore]
@@ -41,7 +41,7 @@ namespace Newtonsoft.Json.Tests.TestObjects
public ulong ULong = long.MaxValue;
public double Double = double.MaxValue;
public float Float = float.MaxValue;
#if !NETFX_CORE
#if !(NETFX_CORE || PORTABLE)
public DBNull DBNull = DBNull.Value;
#endif
public bool Bool = true;
@@ -23,7 +23,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
#endregion
#if !PocketPC && !SILVERLIGHT
#if !(SILVERLIGHT || PORTABLE)
using System;
using System.Reflection;
#if !NETFX_CORE
@@ -1,4 +1,8 @@
using System;
#if PORTABLE
extern alias NewtonsoftJson;
using FormatterAssemblyStyle = NewtonsoftJson::System.Runtime.Serialization.Formatters.FormatterAssemblyStyle;
#endif
using System;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
#if !NETFX_CORE