-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: tl.filter, tl.concatinate, eutl.CheckSignature
- Loading branch information
1 parent
ee68c8d
commit b1fd5ec
Showing
5 changed files
with
86 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.vscode | ||
/node_modules | ||
/typings | ||
/test/test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,50 @@ | ||
/// <reference path="../typings/node/node.d.ts" /> | ||
/// <reference path="../typings/mocha/mocha.d.ts" /> | ||
|
||
var DOMParser = require("xmldom").DOMParser; | ||
global.DOMParser = require("xmldom").DOMParser; | ||
var xadesjs = require("xadesjs"); | ||
global.xadesjs = xadesjs; | ||
var tl_create = require("../built/tl-create"); | ||
console.log("tl_createt", tl_create); | ||
var assert = require("assert"); | ||
|
||
var fs = require("fs"); | ||
|
||
describe("EUTL format", function () { | ||
|
||
it("Test 1", function () { | ||
it("TrustServiceStatusList LoadXML", function () { | ||
// get static file | ||
var eutlText = fs.readFileSync("./test/static/eitl.xml", "utf8"); | ||
var eutlText = fs.readFileSync("./test/static/eutl.xml", "utf8"); | ||
|
||
var eutl = new tl_create.TrustServiceStatusList(); | ||
var xml = new DOMParser().parseFromString(eutlText, "application/xml"); | ||
eutl.LoadXml(xml); | ||
|
||
assert.equal(eutl.SchemaInformation.Pointers.length, 48); | ||
assert.equal(eutl.SchemaInformation.Pointers[0].X509Certificates.length, 2); | ||
}) | ||
|
||
it("TrustServiceStatusList check signature", function (done) { | ||
// get static file | ||
var eutlText = fs.readFileSync("./test/static/eutl.xml", "utf8"); | ||
|
||
var eutl = new tl_create.TrustServiceStatusList(); | ||
var xml = new DOMParser().parseFromString(eutlText, "application/xml"); | ||
eutl.LoadXml(xml); | ||
|
||
eutl.CheckSignature() | ||
.then(function (v) { | ||
assert.equal(v, true, "Wrong signature"); | ||
done(); | ||
}) | ||
.catch(done); | ||
}); | ||
|
||
it("EUTL parse", function () { | ||
// get static file | ||
var eutlText = fs.readFileSync("./test/static/eutl.xml", "utf8"); | ||
|
||
var eutl = new tl_create.EUTL(); | ||
var tl = eutl.parse(eutlText); | ||
assert.equal(tl.Certificates.length, 101); | ||
}); | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters