-Modern project system all the things

This commit is contained in:
James Newton-King
2017-04-27 22:09:01 +12:00
parent 8eecadd0ef
commit 64124e6edd
44 changed files with 305 additions and 5606 deletions
@@ -45,7 +45,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
static DeserializeBenchmarks()
{
LargeJsonText = System.IO.File.ReadAllText("large.json");
LargeJsonText = System.IO.File.ReadAllText(TestFixtureBase.ResolvePath("large.json"));
FloatArrayJson = new JArray(Enumerable.Range(0, 5000).Select(i => i * 1.1m)).ToString(Formatting.None);
}
@@ -59,7 +59,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
[Benchmark]
public IList<RootObject> DeserializeLargeJsonFile()
{
using (var jsonFile = System.IO.File.OpenText("large.json"))
using (var jsonFile = System.IO.File.OpenText(TestFixtureBase.ResolvePath("large.json")))
using (JsonTextReader jsonTextReader = new JsonTextReader(jsonFile))
{
JsonSerializer serializer = new JsonSerializer();
@@ -45,7 +45,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
[Benchmark]
public void ReadLargeJson()
{
using (StreamReader fs = System.IO.File.OpenText("large.json"))
using (StreamReader fs = System.IO.File.OpenText(TestFixtureBase.ResolvePath("large.json")))
using (JsonTextReader jsonTextReader = new JsonTextReader(fs))
{
while (jsonTextReader.Read())
@@ -45,7 +45,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
static SerializeBenchmarks()
{
string json = System.IO.File.ReadAllText("large.json");
string json = System.IO.File.ReadAllText(TestFixtureBase.ResolvePath("large.json"));
LargeCollection = JsonConvert.DeserializeObject<IList<RootObject>>(json);
}
@@ -53,7 +53,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
[Benchmark]
public void SerializeLargeJsonFile()
{
using (StreamWriter file = System.IO.File.CreateText("largewrite.json"))
using (StreamWriter file = System.IO.File.CreateText(TestFixtureBase.ResolvePath("largewrite.json")))
{
JsonSerializer serializer = new JsonSerializer();
serializer.Formatting = Formatting.Indented;
@@ -44,7 +44,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
public void ConvertXmlNode()
{
XmlDocument doc = new XmlDocument();
using (FileStream file = System.IO.File.OpenRead("large_sample.xml"))
using (FileStream file = System.IO.File.OpenRead(TestFixtureBase.ResolvePath("large_sample.xml")))
{
doc.Load(file);
}
@@ -56,7 +56,7 @@ namespace Newtonsoft.Json.Tests.Benchmarks
public void ConvertXNode()
{
XDocument doc;
using (FileStream file = System.IO.File.OpenRead("large_sample.xml"))
using (FileStream file = System.IO.File.OpenRead(TestFixtureBase.ResolvePath("large_sample.xml")))
{
doc = XDocument.Load(file);
}