88
99namespace JsonLD . Test
1010{
11- public class SortingTests
11+ public class ExtendedFunctionalityTests
1212 {
13- [ Theory , MemberData ( nameof ( SortingTestCases ) ) ]
14- public void RunJsonLdApi ( string id , SortingTestCase testCase )
13+ public const string ManifestRoot = "ExtendedFunctionality" ;
14+
15+ [ Theory , MemberData ( nameof ( ExtendedFunctionalityCases ) ) ]
16+ public void ExtendedFunctionalityTestPasses ( string id , ExtendedFunctionalityTestCase testCase )
1517 {
1618 JToken result = testCase . run ( ) ;
1719 if ( testCase . error != null )
@@ -37,7 +39,7 @@ public void RunJsonLdApi(string id, SortingTestCase testCase)
3739 }
3840 }
3941
40- public class SortingTestCase
42+ public class ExtendedFunctionalityTestCase
4143 {
4244 public JToken input { get ; set ; }
4345 public JToken output { get ; set ; }
@@ -47,28 +49,33 @@ public class SortingTestCase
4749 public Func < JToken > run { get ; set ; }
4850 }
4951
50- private static string [ ] GetManifests ( )
52+ public static IEnumerable < object [ ] > ExtendedFunctionalityCases ( )
5153 {
52- return new [ ] {
53- "fromRdf-manifest.jsonld" ,
54- //"compact-manifest.jsonld"
55- } ;
54+ foreach ( var testCase in SortingTestCases ( ) )
55+ {
56+ yield return testCase ;
57+ }
5658 }
5759
60+ private static string [ ] SortingManifests =
61+ {
62+ "fromRdf-manifest.jsonld"
63+ } ;
64+
5865 public static IEnumerable < object [ ] > SortingTestCases ( )
5966 {
60- var manifests = GetManifests ( ) ;
6167 var jsonFetcher = new JsonFetcher ( ) ;
62- var rootDirectory = Path . Combine ( "Sorting" , "W3C" ) ;
63-
64- foreach ( string manifest in manifests )
68+ var rootDirectory = Path . Combine ( ManifestRoot , "Sorting" ) ;
69+ var cases = new List < object [ ] > { } ;
70+
71+ foreach ( string manifest in SortingManifests )
6572 {
6673 JToken manifestJson = jsonFetcher . GetJson ( manifest , rootDirectory ) ;
6774
6875 foreach ( JObject testcase in manifestJson [ "sequence" ] )
6976 {
7077 Func < JToken > run = null ;
71- SortingTestCase newCase = new SortingTestCase ( ) ;
78+ ExtendedFunctionalityTestCase newCase = new ExtendedFunctionalityTestCase ( ) ;
7279
7380 newCase . input = jsonFetcher . GetJson ( manifestJson [ "input" ] , rootDirectory ) ;
7481 newCase . output = jsonFetcher . GetJson ( testcase [ "expect" ] , rootDirectory ) ;
@@ -102,14 +109,7 @@ public static IEnumerable<object[]> SortingTestCases()
102109
103110 var testType = ( string ) testcase [ "test-type" ] ;
104111
105- if ( testType == "jld:Compact" )
106- {
107- newCase . context = jsonFetcher . GetJson ( manifestJson [ "test-context" ] , rootDirectory ) ;
108- Context activeCtx = new Context ( newCase . context , options ) ;
109-
110- run = ( ) => jsonLdApi . Compact ( activeCtx , null , newCase . input ) ;
111- }
112- else if ( testType == "jld:FromRDF" )
112+ if ( testType == "jld:FromRDF" )
113113 {
114114 JToken quads = newCase . input [ "quads" ] ;
115115 RDFDataset rdf = new RDFDataset ( ) ;
0 commit comments