Skip to content

Commit 843fb31

Browse files
committed
added Unit test for ISODurationToCentisecs
1 parent f875770 commit 843fb31

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

QUnit-Tests/js/test/scobot-prod.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ $.addEvent(SB, 'load', function (e) {
192192
test("Max Time Allowed", function () {
193193
var max_time_allowed = SB.getvalue('cmi.max_time_allowed');
194194
strictEqual(max_time_allowed, '', "Checking max time allowed ('')");
195+
// Adding test to make sure ISODurationToCentisecs works properly.
196+
var time = scorm.ISODurationToCentisec("PT10S") * 10;
197+
strictEqual(time, 10000, "Checking ISODurationToCentisecs");
195198
// Note, if you update the CAM to pass imsss:attemptAbsoluteDurationLimit please update this test!
196199
});
197200

QUnit-Tests/js/test/scobot.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ $.addEvent(SB, 'load', function (e) {
188188
test("Max Time Allowed", function () {
189189
var max_time_allowed = SB.getvalue('cmi.max_time_allowed');
190190
strictEqual(max_time_allowed, '', "Checking max time allowed ('')");
191+
// Adding test to make sure ISODurationToCentisecs works properly.
192+
var time = scorm.ISODurationToCentisec("PT10S") * 10;
193+
strictEqual(time, 10000, "Checking ISODurationToCentisecs");
191194
// Note, if you update the CAM to pass imsss:attemptAbsoluteDurationLimit please update this test!
192195
});
193196

QUnit-Tests/js/test/scobot_basic.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ test("Max Time Allowed", function () {
131131
"use strict";
132132
var max_time_allowed = SB.getvalue('cmi.max_time_allowed');
133133
strictEqual(max_time_allowed, '', "Checking max time allowed ('')");
134+
// Adding test to make sure ISODurationToCentisecs works properly.
135+
var time = scorm.ISODurationToCentisec("PT10S") * 10;
136+
strictEqual(time, 10000, "Checking ISODurationToCentisecs");
134137
// Note, if you update the CAM to pass imsss:attemptAbsoluteDurationLimit please update this test!
135138
});
136139

QUnit-Tests/js/test/scobotbase.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,13 @@ test("initialize", function () {
349349
} else {
350350
strictEqual(getvalue('cmi.interactions._count'), getvalue('cmi.interactions._count'), "Getting Objective Count, expecting " + getvalue('cmi.interactions._count'));
351351
}
352+
353+
test("ISO Duration", function() {
354+
// Adding test to make sure ISODurationToCentisecs works properly.
355+
var time = scorm.ISODurationToCentisec("PT10S") * 10;
356+
strictEqual(time, 10000, "Checking ISODurationToCentisecs");
357+
});
358+
352359
// Wrap up scoring
353360
test("setvalue", function () {
354361
strictEqual(setvalue('cmi.score.raw', "1"), 'true', 'Setting cmi.score.raw to 1');

0 commit comments

Comments
 (0)