8
8
9
9
namespace JsonLD . Test
10
10
{
11
- public class SortingTests
11
+ public class ExtendedFunctionalityTests
12
12
{
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 )
15
17
{
16
18
JToken result = testCase . run ( ) ;
17
19
if ( testCase . error != null )
@@ -37,7 +39,7 @@ public void RunJsonLdApi(string id, SortingTestCase testCase)
37
39
}
38
40
}
39
41
40
- public class SortingTestCase
42
+ public class ExtendedFunctionalityTestCase
41
43
{
42
44
public JToken input { get ; set ; }
43
45
public JToken output { get ; set ; }
@@ -47,28 +49,33 @@ public class SortingTestCase
47
49
public Func < JToken > run { get ; set ; }
48
50
}
49
51
50
- private static string [ ] GetManifests ( )
52
+ public static IEnumerable < object [ ] > ExtendedFunctionalityCases ( )
51
53
{
52
- return new [ ] {
53
- "fromRdf-manifest.jsonld" ,
54
- //"compact-manifest.jsonld"
55
- } ;
54
+ foreach ( var testCase in SortingTestCases ( ) )
55
+ {
56
+ yield return testCase ;
57
+ }
56
58
}
57
59
60
+ private static string [ ] SortingManifests =
61
+ {
62
+ "fromRdf-manifest.jsonld"
63
+ } ;
64
+
58
65
public static IEnumerable < object [ ] > SortingTestCases ( )
59
66
{
60
- var manifests = GetManifests ( ) ;
61
67
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 )
65
72
{
66
73
JToken manifestJson = jsonFetcher . GetJson ( manifest , rootDirectory ) ;
67
74
68
75
foreach ( JObject testcase in manifestJson [ "sequence" ] )
69
76
{
70
77
Func < JToken > run = null ;
71
- SortingTestCase newCase = new SortingTestCase ( ) ;
78
+ ExtendedFunctionalityTestCase newCase = new ExtendedFunctionalityTestCase ( ) ;
72
79
73
80
newCase . input = jsonFetcher . GetJson ( manifestJson [ "input" ] , rootDirectory ) ;
74
81
newCase . output = jsonFetcher . GetJson ( testcase [ "expect" ] , rootDirectory ) ;
@@ -102,14 +109,7 @@ public static IEnumerable<object[]> SortingTestCases()
102
109
103
110
var testType = ( string ) testcase [ "test-type" ] ;
104
111
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" )
113
113
{
114
114
JToken quads = newCase . input [ "quads" ] ;
115
115
RDFDataset rdf = new RDFDataset ( ) ;
0 commit comments