Skip to content

Commit 12d548c

Browse files
Merge pull request #5 from Cheukting/dev
[Test] Adding test for idgen and typecast for woql.js
2 parents 9448227 + 49a8f2e commit 12d548c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/woql.spec.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,21 @@ describe('woql queries', function () {
270270

271271
})
272272

273-
it('check the unique method',function(){
273+
it('check the idgen method',function(){
274274

275-
const woqlObject=WOQL.unique("doc:Station_",["v:Start_ID"],"v:Start_IRI");
275+
const woqlObject=WOQL.idgen("doc:Station",["v:Start_ID"],"v:Start_Station_URL");
276276

277-
const jsonObj={ unique: [ 'doc:Station_', { list: ["v:Start_ID"] }, 'v:Start_IRI' ] }
277+
const jsonObj={ "idgen": [ 'doc:Station', { "list": ["v:Start_ID"] }, 'v:Start_Station_URL' ] }
278+
279+
expect(woqlObject.json()).to.eql(jsonObj);
280+
281+
})
282+
283+
it('check the typecast method',function(){
284+
285+
const woqlObject=WOQL.typecast("v:Duration", "xsd:integer", "v:Duration_Cast");
286+
287+
const jsonObj={ "typecast": [ "v:Duration", "xsd:integer", "v:Duration_Cast" ] }
278288

279289
expect(woqlObject.json()).to.eql(jsonObj);
280290

0 commit comments

Comments
 (0)