Migrate to Sdk projects. Migrate tests from NUnit to xUnit.
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using Xunit;
|
||||||
|
|
||||||
namespace VAR.Json.Tests
|
namespace VAR.Json.Tests
|
||||||
{
|
{
|
||||||
[TestFixture()]
|
|
||||||
public class JsonParser_Tests
|
public class JsonParser_Tests
|
||||||
{
|
{
|
||||||
#region Parse
|
#region Parse
|
||||||
@@ -14,15 +13,15 @@ namespace VAR.Json.Tests
|
|||||||
public int Number { get; set; }
|
public int Number { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__SwallowObject()
|
public void Parse__SwallowObject()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
parser.KnownTypes.Add(typeof(SwallowObject));
|
parser.KnownTypes.Add(typeof(SwallowObject));
|
||||||
SwallowObject result = parser.Parse(@"{""Text"": ""AAAA"", ""Number"": 42}") as SwallowObject;
|
SwallowObject result = parser.Parse(@"{""Text"": ""AAAA"", ""Number"": 42}") as SwallowObject;
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
Assert.AreEqual("AAAA", result.Text);
|
Assert.Equal("AAAA", result.Text);
|
||||||
Assert.AreEqual(42, result.Number);
|
Assert.Equal(42, result.Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeeperObject_L1
|
public class DeeperObject_L1
|
||||||
@@ -31,17 +30,17 @@ namespace VAR.Json.Tests
|
|||||||
public SwallowObject Object { get; set; }
|
public SwallowObject Object { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__DeeperObject_L1()
|
public void Parse__DeeperObject_L1()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
parser.KnownTypes.Add(typeof(SwallowObject));
|
parser.KnownTypes.Add(typeof(SwallowObject));
|
||||||
parser.KnownTypes.Add(typeof(DeeperObject_L1));
|
parser.KnownTypes.Add(typeof(DeeperObject_L1));
|
||||||
DeeperObject_L1 result = parser.Parse(@"{""Name"": ""Thing"", ""Object"": {""Text"": ""AAAA"", ""Number"": 42}}") as DeeperObject_L1;
|
DeeperObject_L1 result = parser.Parse(@"{""Name"": ""Thing"", ""Object"": {""Text"": ""AAAA"", ""Number"": 42}}") as DeeperObject_L1;
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
Assert.AreEqual("Thing", result.Name);
|
Assert.Equal("Thing", result.Name);
|
||||||
Assert.AreEqual("AAAA", result.Object.Text);
|
Assert.Equal("AAAA", result.Object.Text);
|
||||||
Assert.AreEqual(42, result.Object.Number);
|
Assert.Equal(42, result.Object.Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeeperObject_L2
|
public class DeeperObject_L2
|
||||||
@@ -50,7 +49,7 @@ namespace VAR.Json.Tests
|
|||||||
public DeeperObject_L1 Object { get; set; }
|
public DeeperObject_L1 Object { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__DeeperObject_L2()
|
public void Parse__DeeperObject_L2()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
@@ -58,23 +57,23 @@ namespace VAR.Json.Tests
|
|||||||
parser.KnownTypes.Add(typeof(DeeperObject_L1));
|
parser.KnownTypes.Add(typeof(DeeperObject_L1));
|
||||||
parser.KnownTypes.Add(typeof(DeeperObject_L2));
|
parser.KnownTypes.Add(typeof(DeeperObject_L2));
|
||||||
DeeperObject_L2 result = parser.Parse(@"{""Count"": 1, ""Object"": {""Name"": ""Thing"", ""Object"": {""Text"": ""AAAA"", ""Number"": 42}}}") as DeeperObject_L2;
|
DeeperObject_L2 result = parser.Parse(@"{""Count"": 1, ""Object"": {""Name"": ""Thing"", ""Object"": {""Text"": ""AAAA"", ""Number"": 42}}}") as DeeperObject_L2;
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
Assert.AreEqual(1, result.Count);
|
Assert.Equal(1, result.Count);
|
||||||
Assert.AreEqual("Thing", result.Object.Name);
|
Assert.Equal("Thing", result.Object.Name);
|
||||||
Assert.AreEqual("AAAA", result.Object.Object.Text);
|
Assert.Equal("AAAA", result.Object.Object.Text);
|
||||||
Assert.AreEqual(42, result.Object.Object.Number);
|
Assert.Equal(42, result.Object.Object.Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__SwallowObjectArray()
|
public void Parse__SwallowObjectArray()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
parser.KnownTypes.Add(typeof(SwallowObject));
|
parser.KnownTypes.Add(typeof(SwallowObject));
|
||||||
List<SwallowObject> result = parser.Parse(@"[{""Text"": ""AAAA"", ""Number"": 42}]") as List<SwallowObject>;
|
List<SwallowObject> result = parser.Parse(@"[{""Text"": ""AAAA"", ""Number"": 42}]") as List<SwallowObject>;
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
Assert.AreEqual(1, result.Count);
|
Assert.Single(result);
|
||||||
Assert.AreEqual("AAAA", result[0].Text);
|
Assert.Equal("AAAA", result[0].Text);
|
||||||
Assert.AreEqual(42, result[0].Number);
|
Assert.Equal(42, result[0].Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeeperObjectArray_L1
|
public class DeeperObjectArray_L1
|
||||||
@@ -83,17 +82,17 @@ namespace VAR.Json.Tests
|
|||||||
public List<SwallowObject> Array { get; set; }
|
public List<SwallowObject> Array { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__DeeperObjectArray_L1()
|
public void Parse__DeeperObjectArray_L1()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
parser.KnownTypes.Add(typeof(SwallowObject));
|
parser.KnownTypes.Add(typeof(SwallowObject));
|
||||||
parser.KnownTypes.Add(typeof(DeeperObjectArray_L1));
|
parser.KnownTypes.Add(typeof(DeeperObjectArray_L1));
|
||||||
DeeperObjectArray_L1 result = parser.Parse(@"{""Count"": 1, ""Array"": [{""Text"": ""AAAA"", ""Number"": 42}]}") as DeeperObjectArray_L1;
|
DeeperObjectArray_L1 result = parser.Parse(@"{""Count"": 1, ""Array"": [{""Text"": ""AAAA"", ""Number"": 42}]}") as DeeperObjectArray_L1;
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
Assert.AreEqual(1, result.Count);
|
Assert.Equal(1, result.Count);
|
||||||
Assert.AreEqual("AAAA", result.Array[0].Text);
|
Assert.Equal("AAAA", result.Array[0].Text);
|
||||||
Assert.AreEqual(42, result.Array[0].Number);
|
Assert.Equal(42, result.Array[0].Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeeperObjectArray_L2
|
public class DeeperObjectArray_L2
|
||||||
@@ -102,7 +101,7 @@ namespace VAR.Json.Tests
|
|||||||
public List<DeeperObjectArray_L1> Objects { get; set; }
|
public List<DeeperObjectArray_L1> Objects { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__DeeperObjectArray_L2()
|
public void Parse__DeeperObjectArray_L2()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
@@ -110,284 +109,284 @@ namespace VAR.Json.Tests
|
|||||||
parser.KnownTypes.Add(typeof(DeeperObjectArray_L1));
|
parser.KnownTypes.Add(typeof(DeeperObjectArray_L1));
|
||||||
parser.KnownTypes.Add(typeof(DeeperObjectArray_L2));
|
parser.KnownTypes.Add(typeof(DeeperObjectArray_L2));
|
||||||
DeeperObjectArray_L2 result = parser.Parse(@"{""Name"": ""Thing"", ""Objects"": [{""Count"": 1, ""Array"": [{""Text"": ""AAAA"", ""Number"": 42}]}]}") as DeeperObjectArray_L2;
|
DeeperObjectArray_L2 result = parser.Parse(@"{""Name"": ""Thing"", ""Objects"": [{""Count"": 1, ""Array"": [{""Text"": ""AAAA"", ""Number"": 42}]}]}") as DeeperObjectArray_L2;
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
Assert.AreEqual("Thing", result.Name);
|
Assert.Equal("Thing", result.Name);
|
||||||
Assert.AreEqual(1, result.Objects[0].Count);
|
Assert.Equal(1, result.Objects[0].Count);
|
||||||
Assert.AreEqual("AAAA", result.Objects[0].Array[0].Text);
|
Assert.Equal("AAAA", result.Objects[0].Array[0].Text);
|
||||||
Assert.AreEqual(42, result.Objects[0].Array[0].Number);
|
Assert.Equal(42, result.Objects[0].Array[0].Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Parse
|
#endregion Parse
|
||||||
|
|
||||||
#region Validity tests
|
#region Validity tests
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail01()
|
public void Parse__Validity_Fail01()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"""A JSON payload should be an object or array, not a string.""");
|
object result = parser.Parse(@"""A JSON payload should be an object or array, not a string.""");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail02()
|
public void Parse__Validity_Fail02()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Unclosed array""");
|
object result = parser.Parse(@"[""Unclosed array""");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail03()
|
public void Parse__Validity_Fail03()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{unquoted_key: ""keys must be quoted""}");
|
object result = parser.Parse(@"{unquoted_key: ""keys must be quoted""}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail04()
|
public void Parse__Validity_Fail04()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""extra comma"",]");
|
object result = parser.Parse(@"[""extra comma"",]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail05()
|
public void Parse__Validity_Fail05()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""double extra comma"",,]");
|
object result = parser.Parse(@"[""double extra comma"",,]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail06()
|
public void Parse__Validity_Fail06()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[ , ""<-- missing value""]");
|
object result = parser.Parse(@"[ , ""<-- missing value""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail07()
|
public void Parse__Validity_Fail07()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Comma after the close""],");
|
object result = parser.Parse(@"[""Comma after the close""],");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail08()
|
public void Parse__Validity_Fail08()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Extra close""]]");
|
object result = parser.Parse(@"[""Extra close""]]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail09()
|
public void Parse__Validity_Fail09()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Extra comma"": true,}");
|
object result = parser.Parse(@"{""Extra comma"": true,}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail10()
|
public void Parse__Validity_Fail10()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Extra value after close"": true} ""misplaced quoted value""");
|
object result = parser.Parse(@"{""Extra value after close"": true} ""misplaced quoted value""");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail11()
|
public void Parse__Validity_Fail11()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Illegal expression"": 1 + 2}");
|
object result = parser.Parse(@"{""Illegal expression"": 1 + 2}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail12()
|
public void Parse__Validity_Fail12()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Illegal invocation"": alert()}");
|
object result = parser.Parse(@"{""Illegal invocation"": alert()}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail13()
|
public void Parse__Validity_Fail13()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Numbers cannot have leading zeroes"": 013}");
|
object result = parser.Parse(@"{""Numbers cannot have leading zeroes"": 013}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail14()
|
public void Parse__Validity_Fail14()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Numbers cannot be hex"": 0x14}");
|
object result = parser.Parse(@"{""Numbers cannot be hex"": 0x14}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail15()
|
public void Parse__Validity_Fail15()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Illegal backslash escape: \x15""]");
|
object result = parser.Parse(@"[""Illegal backslash escape: \x15""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail16()
|
public void Parse__Validity_Fail16()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[\naked]");
|
object result = parser.Parse(@"[\naked]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail17()
|
public void Parse__Validity_Fail17()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Illegal backslash escape: \017""]");
|
object result = parser.Parse(@"[""Illegal backslash escape: \017""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail18()
|
public void Parse__Validity_Fail18()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[[[[[[[[[[[[[[[[[[[[""Too deep""]]]]]]]]]]]]]]]]]]]]");
|
object result = parser.Parse(@"[[[[[[[[[[[[[[[[[[[[""Too deep""]]]]]]]]]]]]]]]]]]]]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail19()
|
public void Parse__Validity_Fail19()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Missing colon"" null}");
|
object result = parser.Parse(@"{""Missing colon"" null}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail20()
|
public void Parse__Validity_Fail20()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Double colon"":: null}");
|
object result = parser.Parse(@"{""Double colon"":: null}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail21()
|
public void Parse__Validity_Fail21()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Comma instead of colon"", null}");
|
object result = parser.Parse(@"{""Comma instead of colon"", null}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail22()
|
public void Parse__Validity_Fail22()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Colon instead of comma"": false]");
|
object result = parser.Parse(@"[""Colon instead of comma"": false]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail23()
|
public void Parse__Validity_Fail23()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""Bad value"", truth]");
|
object result = parser.Parse(@"[""Bad value"", truth]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail24()
|
public void Parse__Validity_Fail24()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"['single quote']");
|
object result = parser.Parse(@"['single quote']");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail25()
|
public void Parse__Validity_Fail25()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"["" tab character in string ""]");
|
object result = parser.Parse(@"["" tab character in string ""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail26()
|
public void Parse__Validity_Fail26()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""tab\ character\ in\ string\ ""]");
|
object result = parser.Parse(@"[""tab\ character\ in\ string\ ""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail27()
|
public void Parse__Validity_Fail27()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""line
|
object result = parser.Parse(@"[""line
|
||||||
break""]");
|
break""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail28()
|
public void Parse__Validity_Fail28()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""line\
|
object result = parser.Parse(@"[""line\
|
||||||
break""]");
|
break""]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail29()
|
public void Parse__Validity_Fail29()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[0e]");
|
object result = parser.Parse(@"[0e]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail30()
|
public void Parse__Validity_Fail30()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[0e+]");
|
object result = parser.Parse(@"[0e+]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail31()
|
public void Parse__Validity_Fail31()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[0e+-1]");
|
object result = parser.Parse(@"[0e+-1]");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail32()
|
public void Parse__Validity_Fail32()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"{""Comma instead if closing brace"": true,");
|
object result = parser.Parse(@"{""Comma instead if closing brace"": true,");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Fail33()
|
public void Parse__Validity_Fail33()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[""mismatch""}");
|
object result = parser.Parse(@"[""mismatch""}");
|
||||||
Assert.AreEqual(true, parser.Tainted);
|
Assert.True(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Pass01()
|
public void Parse__Validity_Pass01()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
@@ -449,18 +448,18 @@ break""]");
|
|||||||
1e-1,
|
1e-1,
|
||||||
1e00,2e+00,2e-00
|
1e00,2e+00,2e-00
|
||||||
,""rosebud""]");
|
,""rosebud""]");
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Pass02()
|
public void Parse__Validity_Pass02()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
object result = parser.Parse(@"[[[[[[[[[[[[[[[[[[[""Not too deep""]]]]]]]]]]]]]]]]]]]");
|
object result = parser.Parse(@"[[[[[[[[[[[[[[[[[[[""Not too deep""]]]]]]]]]]]]]]]]]]]");
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test()]
|
[Fact]
|
||||||
public void Parse__Validity_Pass03()
|
public void Parse__Validity_Pass03()
|
||||||
{
|
{
|
||||||
JsonParser parser = new JsonParser();
|
JsonParser parser = new JsonParser();
|
||||||
@@ -471,7 +470,7 @@ break""]");
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
");
|
");
|
||||||
Assert.AreEqual(false, parser.Tainted);
|
Assert.False(parser.Tainted);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Validity tests
|
#endregion Validity tests
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("VAR.Json.Tests")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("VAR.Json.Tests")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © VAR 2016-2021")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("b92ac920-87d7-46de-afd8-d9c5eff7debe")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
@@ -1,103 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\packages\NUnit3TestAdapter.4.0.0\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.4.0.0\build\net35\NUnit3TestAdapter.props')" />
|
|
||||||
<Import Project="..\packages\NUnit.3.13.2\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.13.2\build\NUnit.props')" />
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{B92AC920-87D7-46DE-AFD8-D9C5EFF7DEBE}</ProjectGuid>
|
<IsPackable>false</IsPackable>
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>VAR.Json.Tests</RootNamespace>
|
|
||||||
<AssemblyName>VAR.Json.Tests</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<TargetFrameworkProfile />
|
|
||||||
<NuGetPackageImportStamp>
|
|
||||||
</NuGetPackageImportStamp>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="nunit.framework, Version=3.13.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||||
<HintPath>..\packages\NUnit.3.13.2\lib\net45\nunit.framework.dll</HintPath>
|
<PackageReference Include="xunit" Version="2.4.1" />
|
||||||
</Reference>
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||||
<Reference Include="System" />
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="coverlet.collector" Version="3.0.3">
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Choose>
|
|
||||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
<Otherwise />
|
|
||||||
</Choose>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="JsonParser_Tests.cs" />
|
<ProjectReference Include="..\VAR.Json\VAR.Json.csproj" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<None Include="packages.config" />
|
</Project>
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\VAR.Json\VAR.Json.csproj">
|
|
||||||
<Project>{28B3F937-145C-4FD4-A75B-A25EA4CC0428}</Project>
|
|
||||||
<Name>VAR.Json</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Choose>
|
|
||||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
|
||||||
<Private>False</Private>
|
|
||||||
</Reference>
|
|
||||||
</ItemGroup>
|
|
||||||
</When>
|
|
||||||
</Choose>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\packages\NUnit.3.13.2\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.13.2\build\NUnit.props'))" />
|
|
||||||
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.4.0.0\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.4.0.0\build\net35\NUnit3TestAdapter.props'))" />
|
|
||||||
</Target>
|
|
||||||
<!-- 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,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="NUnit" version="3.13.2" targetFramework="net461" />
|
|
||||||
<package id="NUnit3TestAdapter" version="4.0.0" targetFramework="net461" />
|
|
||||||
</packages>
|
|
||||||
20
VAR.Json.sln
20
VAR.Json.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 16
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 16.0.30330.147
|
VisualStudioVersion = 16.0.30330.147
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VAR.Json", "VAR.Json\VAR.Json.csproj", "{28B3F937-145C-4FD4-A75B-A25EA4CC0428}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VAR.Json", "VAR.Json\VAR.Json.csproj", "{28B3F937-145C-4FD4-A75B-A25EA4CC0428}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Notes", "Notes", "{4C23A421-5348-48F1-8B67-A4D43E616FDE}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Notes", "Notes", "{4C23A421-5348-48F1-8B67-A4D43E616FDE}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
@@ -11,7 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Notes", "Notes", "{4C23A421
|
|||||||
README.md = README.md
|
README.md = README.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VAR.Json.Tests", "VAR.Json.Tests\VAR.Json.Tests.csproj", "{B92AC920-87D7-46DE-AFD8-D9C5EFF7DEBE}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VAR.Json.Tests", "VAR.Json.Tests\VAR.Json.Tests.csproj", "{0E955F4D-49A9-40BC-94F7-7E2EDB30713B}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -19,14 +19,14 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Debug|Any CPU.ActiveCfg = Debug .Net 4.6.1|Any CPU
|
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Debug|Any CPU.Build.0 = Debug .Net 4.6.1|Any CPU
|
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Release|Any CPU.ActiveCfg = Release .Net 4.6.1|Any CPU
|
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Release|Any CPU.Build.0 = Release .Net 4.6.1|Any CPU
|
{28B3F937-145C-4FD4-A75B-A25EA4CC0428}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B92AC920-87D7-46DE-AFD8-D9C5EFF7DEBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{0E955F4D-49A9-40BC-94F7-7E2EDB30713B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{B92AC920-87D7-46DE-AFD8-D9C5EFF7DEBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{0E955F4D-49A9-40BC-94F7-7E2EDB30713B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B92AC920-87D7-46DE-AFD8-D9C5EFF7DEBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{0E955F4D-49A9-40BC-94F7-7E2EDB30713B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B92AC920-87D7-46DE-AFD8-D9C5EFF7DEBE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{0E955F4D-49A9-40BC-94F7-7E2EDB30713B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
@@ -8,17 +8,13 @@ if exist "%ProgramFiles(x86)%\MSBuild\14.0\bin" set PATH=%ProgramFiles(x86)%\MSB
|
|||||||
set nuget="nuget"
|
set nuget="nuget"
|
||||||
if exist "%~dp0..\packages\NuGet.CommandLine.3.4.3\tools\NuGet.exe" set nuget="%~dp0\..\packages\NuGet.CommandLine.3.4.3\tools\NuGet.exe"
|
if exist "%~dp0..\packages\NuGet.CommandLine.3.4.3\tools\NuGet.exe" set nuget="%~dp0\..\packages\NuGet.CommandLine.3.4.3\tools\NuGet.exe"
|
||||||
|
|
||||||
:: Release .Net 3.5
|
:: Release
|
||||||
Title Building Release .Net 3.5
|
Title Building Release
|
||||||
msbuild VAR.Json.csproj /t:Build /p:Configuration="Release .Net 3.5" /p:Platform="AnyCPU"
|
msbuild VAR.Json.csproj /t:Build /p:Configuration="Release" /p:Platform="AnyCPU"
|
||||||
|
|
||||||
:: Release .Net 4.6.1
|
|
||||||
Title Building Release .Net 4.6.1
|
|
||||||
msbuild VAR.Json.csproj /t:Build /p:Configuration="Release .Net 4.6.1" /p:Platform="AnyCPU"
|
|
||||||
|
|
||||||
:: Packing Nuget
|
:: Packing Nuget
|
||||||
Title Packing Nuget
|
Title Packing Nuget
|
||||||
%nuget% pack VAR.Json.csproj -Verbosity detailed -OutputDir "NuGet" -MSBuildVersion "14.0" -Properties Configuration="Release .Net 4.6.1" -Prop Platform=AnyCPU
|
%nuget% pack VAR.Json.csproj -Verbosity detailed -OutputDir "NuGet" -MSBuildVersion "14.0" -Properties Configuration="Release" -Prop Platform=AnyCPU
|
||||||
|
|
||||||
title Finished
|
title Finished
|
||||||
pause
|
pause
|
||||||
|
|||||||
@@ -1,84 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{28B3F937-145C-4FD4-A75B-A25EA4CC0428}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<RootNamespace>VAR.Json</RootNamespace>
|
<Deterministic>false</Deterministic>
|
||||||
<AssemblyName>VAR.Json</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug .Net 4.6.1|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\net461</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
|
||||||
<LangVersion>6</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release .Net 4.6.1|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\net461</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
|
||||||
<LangVersion>6</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug .Net 3.5|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\net35</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<LangVersion>6</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release .Net 3.5|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\net35</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
|
||||||
<LangVersion>6</LangVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<PackageReference Include="NuGet.CommandLine" Version="5.9.1">
|
||||||
<Reference Include="System.Core" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="JsonParser.cs" />
|
|
||||||
<Compile Include="JsonWriter.cs" />
|
|
||||||
<Compile Include="ObjectActivator.cs" />
|
|
||||||
<Compile Include="ParserContext.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Build.NuGet.cmd" />
|
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="VAR.Json.nuspec" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Nuget\keep.txt" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\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>
|
</Project>
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="NuGet.CommandLine" version="3.4.3" targetFramework="net461" developmentDependency="true" />
|
|
||||||
</packages>
|
|
||||||
Reference in New Issue
Block a user