@@ -26,62 +26,62 @@ public VersionSchemaTests(ITestOutputHelper logger)
2626 [ Fact ]
2727 public void VersionField_BasicScenarios ( )
2828 {
29- json = JObject . Parse ( @"{ ""version"": ""2.3"" }" ) ;
30- Assert . True ( json . IsValid ( this . schema ) ) ;
31- json = JObject . Parse ( @"{ ""version"": ""2.3-beta"" }" ) ;
32- Assert . True ( json . IsValid ( this . schema ) ) ;
33- json = JObject . Parse ( @"{ ""version"": ""2.3-beta-final"" }" ) ;
34- Assert . True ( json . IsValid ( this . schema ) ) ;
35- json = JObject . Parse ( @"{ ""version"": ""2.3-beta.2"" }" ) ;
36- Assert . True ( json . IsValid ( this . schema ) ) ;
37- json = JObject . Parse ( @"{ ""version"": ""2.3-beta.0"" }" ) ;
38- Assert . True ( json . IsValid ( this . schema ) ) ;
39- json = JObject . Parse ( @"{ ""version"": ""2.3-beta.01"" }" ) ;
40- Assert . True ( json . IsValid ( this . schema ) ) ;
41- json = JObject . Parse ( @"{ ""version"": ""1.2.3"" }" ) ;
42- Assert . True ( json . IsValid ( this . schema ) ) ;
43- json = JObject . Parse ( @"{ ""version"": ""1.2.3.4"" }" ) ;
44- Assert . True ( json . IsValid ( this . schema ) ) ;
29+ this . json = JObject . Parse ( @"{ ""version"": ""2.3"" }" ) ;
30+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
31+ this . json = JObject . Parse ( @"{ ""version"": ""2.3-beta"" }" ) ;
32+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
33+ this . json = JObject . Parse ( @"{ ""version"": ""2.3-beta-final"" }" ) ;
34+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
35+ this . json = JObject . Parse ( @"{ ""version"": ""2.3-beta.2"" }" ) ;
36+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
37+ this . json = JObject . Parse ( @"{ ""version"": ""2.3-beta.0"" }" ) ;
38+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
39+ this . json = JObject . Parse ( @"{ ""version"": ""2.3-beta.01"" }" ) ;
40+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
41+ this . json = JObject . Parse ( @"{ ""version"": ""1.2.3"" }" ) ;
42+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
43+ this . json = JObject . Parse ( @"{ ""version"": ""1.2.3.4"" }" ) ;
44+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
4545
46- json = JObject . Parse ( @"{ ""version"": ""02.3"" }" ) ;
47- Assert . False ( json . IsValid ( this . schema ) ) ;
48- json = JObject . Parse ( @"{ ""version"": ""2.03"" }" ) ;
49- Assert . False ( json . IsValid ( this . schema ) ) ;
46+ this . json = JObject . Parse ( @"{ ""version"": ""02.3"" }" ) ;
47+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
48+ this . json = JObject . Parse ( @"{ ""version"": ""2.03"" }" ) ;
49+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
5050 }
5151
5252 [ Fact ]
5353 public void VersionField_HeightMacroPlacement ( )
5454 {
5555 // Valid uses
56- json = JObject . Parse ( @"{ ""version"": ""2.3.0-{height}"" }" ) ;
57- Assert . True ( json . IsValid ( this . schema ) ) ;
58- json = JObject . Parse ( @"{ ""version"": ""2.3.0-{height}.beta"" }" ) ;
59- Assert . True ( json . IsValid ( this . schema ) ) ;
60- json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta.{height}"" }" ) ;
61- Assert . True ( json . IsValid ( this . schema ) ) ;
62- json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta+{height}"" }" ) ;
63- Assert . True ( json . IsValid ( this . schema ) ) ;
56+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.0-{height}"" }" ) ;
57+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
58+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.0-{height}.beta"" }" ) ;
59+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
60+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta.{height}"" }" ) ;
61+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
62+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta+{height}"" }" ) ;
63+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
6464
6565 // Invalid uses
66- json = JObject . Parse ( @"{ ""version"": ""2.3.{height}-beta"" }" ) ;
67- Assert . False ( json . IsValid ( this . schema ) ) ;
68- json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta-{height}"" }" ) ;
69- Assert . False ( json . IsValid ( this . schema ) ) ;
70- json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta+height-{height}"" }" ) ;
71- Assert . False ( json . IsValid ( this . schema ) ) ;
66+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.{height}-beta"" }" ) ;
67+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
68+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta-{height}"" }" ) ;
69+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
70+ this . json = JObject . Parse ( @"{ ""version"": ""2.3.0-beta+height-{height}"" }" ) ;
71+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
7272 }
7373
7474 [ Fact ]
7575 public void Inherit_AllowsOmissionOfVersion ( )
7676 {
77- json = JObject . Parse ( @"{ ""inherit"": false, ""version"": ""1.2"" }" ) ;
78- Assert . True ( json . IsValid ( this . schema ) ) ;
79- json = JObject . Parse ( @"{ ""inherit"": false }" ) ;
80- Assert . False ( json . IsValid ( this . schema ) ) ;
81- json = JObject . Parse ( @"{ }" ) ;
82- Assert . False ( json . IsValid ( this . schema ) ) ;
77+ this . json = JObject . Parse ( @"{ ""inherit"": false, ""version"": ""1.2"" }" ) ;
78+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
79+ this . json = JObject . Parse ( @"{ ""inherit"": false }" ) ;
80+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
81+ this . json = JObject . Parse ( @"{ }" ) ;
82+ Assert . False ( this . json . IsValid ( this . schema ) ) ;
8383
84- json = JObject . Parse ( @"{ ""inherit"": true }" ) ;
85- Assert . True ( json . IsValid ( this . schema ) ) ;
84+ this . json = JObject . Parse ( @"{ ""inherit"": true }" ) ;
85+ Assert . True ( this . json . IsValid ( this . schema ) ) ;
8686 }
8787}
0 commit comments