-Tests
This commit is contained in:
+8
-8
@@ -83,7 +83,7 @@ task Package -depends Build {
|
|||||||
$name = $build.TestsName
|
$name = $build.TestsName
|
||||||
$finalDir = $build.FinalDir
|
$finalDir = $build.FinalDir
|
||||||
|
|
||||||
robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\Package\Bin\$finalDir *.dll *.pdb *.xml /NP /XO /XF *.CodeAnalysisLog.xml | Out-Default
|
robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\Package\Bin\$finalDir *.dll *.pdb *.xml /NFL /NDL /NJS /NC /NS /NP /XO /XF *.CodeAnalysisLog.xml | Out-Default
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($buildNuGet)
|
if ($buildNuGet)
|
||||||
@@ -115,12 +115,12 @@ task Package -depends Build {
|
|||||||
|
|
||||||
foreach ($frameworkDir in $frameworkDirs)
|
foreach ($frameworkDir in $frameworkDirs)
|
||||||
{
|
{
|
||||||
robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\NuGet\lib\$frameworkDir *.dll *.pdb *.xml /NP /XO /XF *.CodeAnalysisLog.xml | Out-Default
|
robocopy "$sourceDir\Newtonsoft.Json\bin\Release\$finalDir" $workingDir\NuGet\lib\$frameworkDir *.dll *.pdb *.xml /NFL /NDL /NJS /NC /NS /NP /XO /XF *.CodeAnalysisLog.xml | Out-Default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
robocopy $sourceDir $workingDir\NuGet\src *.cs /S /NP /XD Newtonsoft.Json.Tests Newtonsoft.Json.TestConsole obj | Out-Default
|
robocopy $sourceDir $workingDir\NuGet\src *.cs /S /NFL /NDL /NJS /NC /NS /NP /XD Newtonsoft.Json.Tests Newtonsoft.Json.TestConsole obj | Out-Default
|
||||||
|
|
||||||
exec { .\Tools\NuGet\NuGet.exe pack $nuspecPath -Symbols }
|
exec { .\Tools\NuGet\NuGet.exe pack $nuspecPath -Symbols }
|
||||||
move -Path .\*.nupkg -Destination $workingDir\NuGet
|
move -Path .\*.nupkg -Destination $workingDir\NuGet
|
||||||
@@ -149,10 +149,10 @@ task Package -depends Build {
|
|||||||
# exclude package directories but keep packages\repositories.config
|
# exclude package directories but keep packages\repositories.config
|
||||||
$packageDirs = gci $sourceDir\packages | where {$_.PsIsContainer} | Select -ExpandProperty Name
|
$packageDirs = gci $sourceDir\packages | where {$_.PsIsContainer} | Select -ExpandProperty Name
|
||||||
|
|
||||||
robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NP /XD bin obj TestResults AppPackages $packageDirs /XF *.suo *.user | Out-Default
|
robocopy $sourceDir $workingDir\Package\Source\Src /MIR /NFL /NDL /NJS /NC /NS /NP /XD bin obj TestResults AppPackages $packageDirs /XF *.suo *.user | Out-Default
|
||||||
robocopy $buildDir $workingDir\Package\Source\Build /MIR /NP /XF runbuild.txt | Out-Default
|
robocopy $buildDir $workingDir\Package\Source\Build /MIR /NFL /NDL /NJS /NC /NS /NP /XF runbuild.txt | Out-Default
|
||||||
robocopy $docDir $workingDir\Package\Source\Doc /MIR /NP | Out-Default
|
robocopy $docDir $workingDir\Package\Source\Doc /MIR /NFL /NDL /NJS /NC /NS /NP | Out-Default
|
||||||
robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NP | Out-Default
|
robocopy $toolsDir $workingDir\Package\Source\Tools /MIR /NFL /NDL /NJS /NC /NS /NP | Out-Default
|
||||||
|
|
||||||
exec { .\Tools\7-zip\7za.exe a -tzip $workingDir\$zipFileName $workingDir\Package\* | Out-Default } "Error zipping"
|
exec { .\Tools\7-zip\7za.exe a -tzip $workingDir\$zipFileName $workingDir\Package\* | Out-Default } "Error zipping"
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ function NUnitTests($build)
|
|||||||
|
|
||||||
Write-Host -ForegroundColor Green "Copying test assembly $name to deployed directory"
|
Write-Host -ForegroundColor Green "Copying test assembly $name to deployed directory"
|
||||||
Write-Host
|
Write-Host
|
||||||
robocopy ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir" $workingDir\Deployed\Bin\$finalDir /MIR /NP /XO | Out-Default
|
robocopy ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir" $workingDir\Deployed\Bin\$finalDir /MIR /NFL /NDL /NJS /NC /NS /NP /XO | Out-Default
|
||||||
|
|
||||||
Copy-Item -Path ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir\Newtonsoft.Json.Tests.dll" -Destination $workingDir\Deployed\Bin\$finalDir\
|
Copy-Item -Path ".\Src\Newtonsoft.Json.Tests\bin\Release\$finalDir\Newtonsoft.Json.Tests.dll" -Destination $workingDir\Deployed\Bin\$finalDir\
|
||||||
|
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ namespace Newtonsoft.Json.Tests.Bson
|
|||||||
|
|
||||||
JObject o = (JObject)JObject.ReadFrom(new BsonReader(new MemoryStream(ms.ToArray())));
|
JObject o = (JObject)JObject.ReadFrom(new BsonReader(new MemoryStream(ms.ToArray())));
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Regex"": ""/(hi)/iux""
|
""Regex"": ""/(hi)/iux""
|
||||||
}", o.ToString());
|
}", o.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
|||||||
|
|
||||||
string json = JsonConvert.SerializeObject(d, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(d, Formatting.Indented);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""result"": {
|
""result"": {
|
||||||
""@xp_0:end"": ""2014-08-15 13:12:11.9184"",
|
""@xp_0:end"": ""2014-08-15 13:12:11.9184"",
|
||||||
""@xp_0:start"": ""2014-08-15 13:11:49.3140"",
|
""@xp_0:start"": ""2014-08-15 13:11:49.3140"",
|
||||||
@@ -897,7 +897,7 @@ namespace Newtonsoft.Json.Tests.Converters
|
|||||||
|
|
||||||
string jsonText = SerializeXmlNode(doc);
|
string jsonText = SerializeXmlNode(doc);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""?xml"": {
|
""?xml"": {
|
||||||
""@version"": ""1.0"",
|
""@version"": ""1.0"",
|
||||||
""@standalone"": ""no""
|
""@standalone"": ""no""
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
// "Date": new Date(1401796800000)
|
// "Date": new Date(1401796800000)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Name"": ""Serialize All The Things"",
|
""Name"": ""Serialize All The Things"",
|
||||||
""Date"": new Date(
|
""Date"": new Date(
|
||||||
1401796800000
|
1401796800000
|
||||||
@@ -317,7 +317,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
// "Name": "Mike Manager"
|
// "Name": "Mike Manager"
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Reportees"": [
|
""Reportees"": [
|
||||||
{
|
{
|
||||||
""Name"": ""Arnie Admin""
|
""Name"": ""Arnie Admin""
|
||||||
@@ -374,7 +374,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
// ]
|
// ]
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""$id"": ""1"",
|
""$id"": ""1"",
|
||||||
""$type"": ""Newtonsoft.Json.Tests.DemoTests+Manager, Newtonsoft.Json.Tests"",
|
""$type"": ""Newtonsoft.Json.Tests.DemoTests+Manager, Newtonsoft.Json.Tests"",
|
||||||
""Reportees"": [
|
""Reportees"": [
|
||||||
@@ -570,7 +570,7 @@ namespace Newtonsoft.Json.Tests
|
|||||||
// ]
|
// ]
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""FirstName"": ""John"",
|
""FirstName"": ""John"",
|
||||||
""LastName"": ""Smith"",
|
""LastName"": ""Smith"",
|
||||||
""Enabled"": true,
|
""Enabled"": true,
|
||||||
|
|||||||
@@ -635,7 +635,7 @@ Parameter name: arrayIndex");
|
|||||||
moss["Department"] = new JValue("IT");
|
moss["Department"] = new JValue("IT");
|
||||||
moss["JobTitle"] = new JValue("Support");
|
moss["JobTitle"] = new JValue("Support");
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""FirstName"": ""Maurice"",
|
""FirstName"": ""Maurice"",
|
||||||
""LastName"": ""Moss"",
|
""LastName"": ""Moss"",
|
||||||
""BirthDate"": ""1977-12-30T00:00:00"",
|
""BirthDate"": ""1977-12-30T00:00:00"",
|
||||||
@@ -650,7 +650,7 @@ Parameter name: arrayIndex");
|
|||||||
jen["Department"] = "IT";
|
jen["Department"] = "IT";
|
||||||
jen["JobTitle"] = "Manager";
|
jen["JobTitle"] = "Manager";
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""FirstName"": ""Jen"",
|
""FirstName"": ""Jen"",
|
||||||
""LastName"": ""Barber"",
|
""LastName"": ""Barber"",
|
||||||
""BirthDate"": ""1978-03-15T00:00:00"",
|
""BirthDate"": ""1978-03-15T00:00:00"",
|
||||||
|
|||||||
@@ -1109,7 +1109,7 @@ namespace Newtonsoft.Json.Tests.Linq
|
|||||||
|
|
||||||
JArray a2 = (JArray)a.DeepClone();
|
JArray a2 = (JArray)a.DeepClone();
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
5,
|
5,
|
||||||
[
|
[
|
||||||
1
|
1
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ undefined
|
|||||||
|
|
||||||
foreach (JObject friend in items)
|
foreach (JObject friend in items)
|
||||||
{
|
{
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""name"": ""value!""
|
""name"": ""value!""
|
||||||
}", friend.ToString());
|
}", friend.ToString());
|
||||||
}
|
}
|
||||||
@@ -715,7 +715,7 @@ keyword such as type of business.""
|
|||||||
from c in p.Categories
|
from c in p.Categories
|
||||||
select new JValue(c)))))))));
|
select new JValue(c)))))))));
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""channel"": {
|
""channel"": {
|
||||||
""title"": ""James Newton-King"",
|
""title"": ""James Newton-King"",
|
||||||
""link"": ""http://james.newtonking.com"",
|
""link"": ""http://james.newtonking.com"",
|
||||||
@@ -987,7 +987,7 @@ keyword such as type of business.""
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""channel"": {
|
""channel"": {
|
||||||
""title"": ""James Newton-King"",
|
""title"": ""James Newton-King"",
|
||||||
""link"": ""http://james.newtonking.com"",
|
""link"": ""http://james.newtonking.com"",
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
|
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
|
||||||
});
|
});
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""$type"": ""System.Dynamic.ExpandoObject, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"",
|
""$type"": ""System.Dynamic.ExpandoObject, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"",
|
||||||
""Text"": ""Text!"",
|
""Text"": ""Text!"",
|
||||||
""Integer"": 2147483647,
|
""Integer"": 2147483647,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
|
|
||||||
string json = JsonConvert.SerializeObject(e, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(e, Formatting.Indented);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""extensionData1"": [
|
""extensionData1"": [
|
||||||
1,
|
1,
|
||||||
2,
|
2,
|
||||||
|
|||||||
@@ -2227,7 +2227,7 @@ keyword such as type of business.""
|
|||||||
|
|
||||||
string json = JsonConvert.SerializeObject(c, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(c, Formatting.Indented);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""DefaultConverter"": ""1970-01-01T00:00:00Z"",
|
""DefaultConverter"": ""1970-01-01T00:00:00Z"",
|
||||||
""MemberConverter"": ""1970-01-01T00:00:00Z""
|
""MemberConverter"": ""1970-01-01T00:00:00Z""
|
||||||
}", json);
|
}", json);
|
||||||
@@ -5684,7 +5684,7 @@ Path '', line 1, position 1.");
|
|||||||
// ""nonVirtualMember"": ""NonVirtualMember!""
|
// ""nonVirtualMember"": ""NonVirtualMember!""
|
||||||
//}", result);
|
//}", result);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""virtualMember"": ""VirtualMember!"",
|
""virtualMember"": ""VirtualMember!"",
|
||||||
""nonVirtualMember"": ""NonVirtualMember!""
|
""nonVirtualMember"": ""NonVirtualMember!""
|
||||||
}", result);
|
}", result);
|
||||||
@@ -6896,7 +6896,7 @@ Path '', line 1, position 1.");
|
|||||||
JValue v = (JValue)a[0];
|
JValue v = (JValue)a[0];
|
||||||
|
|
||||||
Assert.AreEqual(typeof(string), v.Value.GetType());
|
Assert.AreEqual(typeof(string), v.Value.GetType());
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
""2000-01-02T03:04:05+06:00""
|
""2000-01-02T03:04:05+06:00""
|
||||||
]", a.ToString());
|
]", a.ToString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
};
|
};
|
||||||
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);
|
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""$type"": ""System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Guid, mscorlib]], mscorlib"",
|
""$type"": ""System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Guid, mscorlib]], mscorlib"",
|
||||||
""k1"": ""5dd2dba0-20c0-49f8-a054-1fa3b0a8d774""
|
""k1"": ""5dd2dba0-20c0-49f8-a054-1fa3b0a8d774""
|
||||||
}", serializedString);
|
}", serializedString);
|
||||||
@@ -259,7 +259,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
|
|
||||||
string json = JsonConvert.SerializeObject(child, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(child, Formatting.Indented);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""_id"": 2,
|
""_id"": 2,
|
||||||
""Name"": ""Isabell"",
|
""Name"": ""Isabell"",
|
||||||
""Father"": {
|
""Father"": {
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
Assert.AreEqual(null, obj.Member5);
|
Assert.AreEqual(null, obj.Member5);
|
||||||
|
|
||||||
string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
|
string json = JsonConvert.SerializeObject(obj, Formatting.Indented);
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""Member1"": 11,
|
""Member1"": 11,
|
||||||
""Member2"": ""This value went into the data file during serialization."",
|
""Member2"": ""This value went into the data file during serialization."",
|
||||||
""Member4"": null
|
""Member4"": null
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
{
|
{
|
||||||
""Name"": ""Joe Employee"",
|
""Name"": ""Joe Employee"",
|
||||||
""Manager"": {
|
""Manager"": {
|
||||||
@@ -331,7 +331,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
// }
|
// }
|
||||||
//]
|
//]
|
||||||
|
|
||||||
Assert.AreEqual(@"[
|
StringAssert.AreEqual(@"[
|
||||||
{
|
{
|
||||||
""Name"": ""Joe Family Details"",
|
""Name"": ""Joe Family Details"",
|
||||||
""NumberOfChildren"": 4
|
""NumberOfChildren"": 4
|
||||||
|
|||||||
@@ -1660,7 +1660,7 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
};
|
};
|
||||||
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);
|
string serializedString = JsonConvert.SerializeObject(inputContext, jsonSerializerSettings);
|
||||||
|
|
||||||
Assert.AreEqual(@"{
|
StringAssert.AreEqual(@"{
|
||||||
""$type"": ""System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Guid, mscorlib]], mscorlib"",
|
""$type"": ""System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.Guid, mscorlib]], mscorlib"",
|
||||||
""k1"": ""a6e986df-fc2c-4906-a1ef-9492388f7833""
|
""k1"": ""a6e986df-fc2c-4906-a1ef-9492388f7833""
|
||||||
}", serializedString);
|
}", serializedString);
|
||||||
|
|||||||
Reference in New Issue
Block a user