Add: isValidPlayerID, isValidPlayerPW

This commit is contained in:
2018-07-18 21:16:49 +09:00
parent 53565189a2
commit 2f9c979a6f
2 changed files with 138 additions and 8 deletions
+86 -7
View File
@@ -25,7 +25,6 @@ QUnit.test( "AccountValidator - isValidMaestroID", function( assert ) {
QUnit.test( "AccountValidator - isValidMaestroPW", function( assert ) {
let text = "";
text = "";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
text = "1";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
@@ -39,25 +38,105 @@ QUnit.test( "AccountValidator - isValidMaestroPW", function( assert ) {
assert.equal(accountValidator.isValidMaestroPW(text), true, "isValidMaestroPW - " + text);
text = "123456";
assert.equal(accountValidator.isValidMaestroPW(text), true, "isValidMaestroPW - " + text);
text = "1234567";
text = "1234567891234567";
assert.equal(accountValidator.isValidMaestroPW(text), true, "isValidMaestroPW - " + text);
text = "12345678912345678";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - no text");
text = "1abcde";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
assert.equal(accountValidator.isValidMaestroPW(text), true, "isValidMaestroPW - " + text);
text = "abc";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
text = "a1b";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
text = "abcdeabcdeabcdeabcdea";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
text = "abcdeabcdeabcdeabcde";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
});
QUnit.test( "AccountValidator - isValidPlayerID", function( assert ) {
let text = "";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - no text");
text = "1abcde";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "abc";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "a1b";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "abcdeabcdeabcdeabcdea";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
text = "abcd";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "aA1Bccd";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroPW - " + text);
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "abcdeabcdeabcdeabcde";
assert.equal(accountValidator.isValidMaestroPW(text), false, "isValidMaestroID - " + text);
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
text = "박지상";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "박지상76";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "박";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "ㅂ";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
text = "박지상박세나";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "박지상박세나신현";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "박지상박세나ab";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "박지상박세나abc";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
text = "박지상박세나신현주";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
text = "박지상박세나123";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
text = "1-3박세나";
assert.equal(accountValidator.isValidPlayerID(text), true, "isValidPlayerID - " + text);
text = "1-4 박지상";
assert.equal(accountValidator.isValidPlayerID(text), false, "isValidPlayerID - " + text);
});
QUnit.test( "AccountValidator - isValidPlayerPW", function( assert ) {
let text = "";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "1";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "12";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "123";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "1234";
assert.equal(accountValidator.isValidPlayerPW(text), true, "isValidPlayerPW - " + text);
text = "12345";
assert.equal(accountValidator.isValidPlayerPW(text), true, "isValidPlayerPW - " + text);
text = "123456";
assert.equal(accountValidator.isValidPlayerPW(text), true, "isValidPlayerPW - " + text);
text = "1234567";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - no text");
text = "1abcde";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "abc";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "a1b";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "abcdeabcdeabcdeabcdea";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "abcd";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "aA1Bccd";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
text = "abcdeabcdeabcdeabcde";
assert.equal(accountValidator.isValidPlayerPW(text), false, "isValidPlayerPW - " + text);
});