Fix: getHighestRecord -> getHighestRecordForWriting
This commit is contained in:
+116
-13
@@ -1,3 +1,82 @@
|
||||
//////////////////////////////////////////////////
|
||||
// typing exam highest record DB
|
||||
|
||||
QUnit.test( "TypingExamHighestRecord", function( assert ) {
|
||||
var MAESTRO_ID = 3; // 삼화초
|
||||
var PLAYER_ID = 35; // 박지상
|
||||
|
||||
var dbService = new DBService();
|
||||
dbService.setMaestroID(MAESTRO_ID);
|
||||
dbService.setPlayerID(PLAYER_ID);
|
||||
|
||||
var WRITING_ID = 1;
|
||||
var RECORD = 123.456;
|
||||
|
||||
dbService.tddSetup(
|
||||
"deleteTypingExamHighestRecordAll",
|
||||
(function(jsonData) { // onSucceeded
|
||||
// console.log(jsonData);
|
||||
addTypingExamHighestRecord();
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
// console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
function addTypingExamHighestRecord()
|
||||
{
|
||||
dbService.tddRun(
|
||||
"addTypingExamHighestRecord",
|
||||
(function(jsonData) { // onSucceeded
|
||||
// console.log(jsonData);
|
||||
updateTypingExamHighestRecord();
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
// console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
function updateTypingExamHighestRecord()
|
||||
{
|
||||
dbService.tddRun(
|
||||
"updateTypingExamHighestRecord",
|
||||
(function(jsonData) { // onSucceeded
|
||||
// console.log(jsonData);
|
||||
getTypingExamHighestRecord();
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
// console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
}
|
||||
|
||||
var done = assert.async();
|
||||
function getTypingExamHighestRecord()
|
||||
{
|
||||
setTimeout(function() {
|
||||
var UPDATED_RECORD = 133.456;
|
||||
|
||||
dbService.tddRun(
|
||||
"getTypingExamHigestRecord",
|
||||
(function(jsonData) { // onSucceeded
|
||||
// console.log(jsonData);
|
||||
|
||||
var highestRecord = jsonData["typingExamHighestRecordData"];
|
||||
assert.equal(highestRecord["highestRecord"], UPDATED_RECORD, "highest record");
|
||||
done();
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
// console.log(jsonData);
|
||||
done();
|
||||
}).bind(this)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// typing exam DB
|
||||
|
||||
@@ -6,30 +85,54 @@ QUnit.test( "TypingExam", function( assert ) {
|
||||
dbService.setMaestroID(3); // 삼화초
|
||||
dbService.setPlayerID(35); // 박지상
|
||||
|
||||
var writingIDForTest = 1;
|
||||
var recordForTest = 117.89;
|
||||
|
||||
dbService.tddSetup(
|
||||
"deleteTypingExamRecordAll",
|
||||
(function(jsonData) { // onSucceeded
|
||||
console.log(jsonData);
|
||||
// console.log(jsonData);
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
console.log(jsonData);
|
||||
// console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
// dbService.tddSetup(
|
||||
// "deleteTypingExamHighestRecordAll",
|
||||
// (function(jsonData) { // onSucceeded
|
||||
// // console.log(jsonData);
|
||||
// }).bind(this),
|
||||
// (function(jsonData) { // onFailed
|
||||
// // console.log(jsonData);
|
||||
// }).bind(this)
|
||||
// );
|
||||
|
||||
dbService.addPrevHourTypingExamRecord(
|
||||
1, //writingRecord
|
||||
120.35, // record
|
||||
writingIDForTest, //writingRecord
|
||||
recordForTest + 10, // record
|
||||
(function(jsonData) { // onSucceeded
|
||||
console.log(jsonData);
|
||||
// console.log(jsonData);
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
console.log(jsonData);
|
||||
// console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
dbService.updateTypingExamRecord(
|
||||
1, //writingRecord
|
||||
105.53, // record
|
||||
writingIDForTest, //writingRecord
|
||||
recordForTest - 10, // record
|
||||
(function(jsonData) { // onSucceeded
|
||||
// console.log(jsonData);
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
// console.log(jsonData);
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
dbService.updateTypingExamRecord(
|
||||
writingIDForTest, //writingRecord
|
||||
recordForTest, // record
|
||||
(function(jsonData) { // onSucceeded
|
||||
console.log(jsonData);
|
||||
}).bind(this),
|
||||
@@ -38,15 +141,16 @@ QUnit.test( "TypingExam", function( assert ) {
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
/*
|
||||
var done = assert.async();
|
||||
setTimeout(function() {
|
||||
dbService.getHighestRecord(
|
||||
dbService.getTypingExamHighestRecord(
|
||||
writingIDForTest,
|
||||
(function(jsonData) { // onSucceeded
|
||||
console.log(jsonData);
|
||||
|
||||
var record = jsonData["highestRecord"];
|
||||
assert.equal(record, 100, "highest record");
|
||||
var highestRecord = jsonData["highestRecordData"];
|
||||
assert.equal(highestRecord["writingID"], writingIDForTest, "highest record");
|
||||
assert.equal(highestRecord["highestRecord"], recordForTest, "highest record");
|
||||
done();
|
||||
}).bind(this),
|
||||
(function(jsonData) { // onFailed
|
||||
@@ -55,7 +159,6 @@ QUnit.test( "TypingExam", function( assert ) {
|
||||
}).bind(this)
|
||||
);
|
||||
});
|
||||
*/
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user