1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15import account from '@ohos.account.appAccount' 16import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' 17 18const TIMEOUT = 5000; 19const STRCOUNT = 1025; 20const EACHTIMEOUT = 500; 21export default function ActsAccountErrCode() { 22 describe('ActsAccountErrCode', function () { 23 24 /* 25 * @tc.number : ActsAccountErrCode_0100 26 * @tc.name : createAccount callback 27 * @tc.desc : test the number of parameters does not match (需要的参数顺序正确,后面有多余的,不报错) 28 */ 29 it('ActsAccountErrCode_0100', 0, async function (done) { 30 console.info("====>ActsAccountErrCode_0100 start===="); 31 var appAccountManager = account.createAppAccountManager(); 32 console.info("====>ActsAccountErrCode_0100 creat finish===="); 33 try { 34 appAccountManager.createAccount("test_account_name", {"test_key":"test_extrainfo"}, (err)=>{ 35 console.info("====>ActsAccountErrCode_0100 create account callback err:" + JSON.stringify(err)); 36 expect(err).assertEqual(null); 37 appAccountManager.removeAccount("test_account_name", (err)=>{ 38 console.info("====>ActsAccountErrCode_0100 delete Account err:" + JSON.stringify(err)); 39 expect(err).assertEqual(null); 40 console.info("====>ActsAccountErrCode_0100 end===="); 41 done(); 42 }); 43 }, "test_more_param") 44 } catch(err) { 45 console.info("====>ActsAccountErrCode_0100 create account catch err:" + JSON.stringify(err)); 46 expect().assertFail(); 47 console.info("====>ActsAccountErrCode_0100 end===="); 48 done(); 49 } 50 51 }); 52 53 /* 54 * @tc.number : ActsAccountErrCode_0200 55 * @tc.name : createAccount callback 56 * @tc.desc : test the number of parameters does not match(需要的参数顺序中有多余类型参数) 57 */ 58 it('ActsAccountErrCode_0200', 0, async function (done) { 59 console.info("====>ActsAccountErrCode_0200 start===="); 60 var appAccountManager = account.createAppAccountManager(); 61 console.info("====>ActsAccountErrCode_0200 creat finish===="); 62 try { 63 appAccountManager.createAccount("test_account_name", {"test_key":"test_extrainfo"}, "test_more_param", (err)=>{ 64 console.info("====>ActsAccountErrCode_0200 create account callback err:" + JSON.stringify(err)); 65 expect().assertFail(); 66 done(); 67 }) 68 } catch(err) { 69 console.info("====>ActsAccountErrCode_0200 create account catch err:" + JSON.stringify(err)); 70 expect(err.code).assertEqual(401); 71 console.info("====>ActsAccountErrCode_0200 end===="); 72 done(); 73 } 74 75 }); 76 77 /* 78 * @tc.number : ActsAccountErrCode_0300 79 * @tc.name : createAccount callback 80 * @tc.desc : test the number of parameters does not match(需要的参数数量少于预期) 81 */ 82 it('ActsAccountErrCode_0300', 0, async function (done) { 83 console.info("====>ActsAccountErrCode_0300 start===="); 84 var appAccountManager = account.createAppAccountManager(); 85 console.info("====>ActsAccountErrCode_0300 creat finish===="); 86 try { 87 appAccountManager.createAccount((err)=>{ 88 console.info("====>ActsAccountErrCode_0300 create account callback err:" + JSON.stringify(err)); 89 expect().assertFail(); 90 done(); 91 }) 92 } catch(err) { 93 console.info("====>ActsAccountErrCode_0300 create account catch err:" + JSON.stringify(err)); 94 expect(err.code).assertEqual(401); 95 console.info("====>ActsAccountErrCode_0300 end===="); 96 done(); 97 } 98 }); 99 100 /* 101 * @tc.number : ActsAccountErrCode_0400 102 * @tc.name : createAccount callback 103 * @tc.desc : test the type of parameters does not match(name不匹配) 104 */ 105 it('ActsAccountErrCode_0400', 0, async function (done) { 106 console.info("====>ActsAccountErrCode_0400 start===="); 107 var appAccountManager = account.createAppAccountManager(); 108 console.info("====>ActsAccountErrCode_0400 creat finish===="); 109 try { 110 appAccountManager.createAccount(123456, {"test_key":"test_extrainfo"}, (err)=>{ 111 console.info("====>ActsAccountErrCode_0400 create account callback err:" + JSON.stringify(err)); 112 expect().assertFail(); 113 done(); 114 }) 115 } catch(err) { 116 console.info("====>ActsAccountErrCode_0400 create account catch err:" + JSON.stringify(err)); 117 expect(err.code).assertEqual(401); 118 console.info("====>ActsAccountErrCode_0400 end===="); 119 done(); 120 } 121 }); 122 123 /* 124 * @tc.number : ActsAccountErrCode_0500 125 * @tc.name : createAccount callback 126 * @tc.desc : test the type of parameters does not match(extrainfo不匹配) 127 */ 128 it('ActsAccountErrCode_0500', 0, async function (done) { 129 console.info("====>ActsAccountErrCode_0500 start===="); 130 var appAccountManager = account.createAppAccountManager(); 131 console.info("====>ActsAccountErrCode_0500 creat finish===="); 132 try { 133 appAccountManager.createAccount("test_account_name", " ", (err)=>{ 134 console.info("====>ActsAccountErrCode_0500 create account callback err:" + JSON.stringify(err)); 135 expect().assertFail(); 136 done(); 137 }) 138 } catch(err) { 139 console.info("====>ActsAccountErrCode_0500 create account catch err:" + JSON.stringify(err)); 140 expect(err.code).assertEqual(401); 141 console.info("====>ActsAccountErrCode_0500 end===="); 142 done(); 143 } 144 }); 145 146 /* 147 * @tc.number : ActsAccountErrCode_0510 148 * @tc.name : createAccount callback 149 * @tc.desc : test the type of parameters does not match(callback不匹配) 150 */ 151 it('ActsAccountErrCode_0510', 0, async function (done) { 152 console.info("====>ActsAccountErrCode_0510 start===="); 153 var appAccountManager = account.createAppAccountManager(); 154 console.info("====>ActsAccountErrCode_0510 creat finish===="); 155 try { 156 appAccountManager.createAccount(123456, {"test_key":"test_extrainfo"}, 1234); 157 } catch(err) { 158 console.info("====>ActsAccountErrCode_0510 create account catch err:" + JSON.stringify(err)); 159 expect(err.code).assertEqual(401); 160 console.info("====>ActsAccountErrCode_0510 end===="); 161 done(); 162 } 163 }); 164 165 /* 166 * @tc.number : ActsAccountErrCode_0600 167 * @tc.name : createAccount promise 168 * @tc.desc : test the number of parameters does not match 169 */ 170 it('ActsAccountErrCode_0600', 0, async function (done) { 171 console.info("====>ActsAccountErrCode_0600 start===="); 172 var appAccountManager = account.createAppAccountManager(); 173 console.info("====>ActsAccountErrCode_0600 creat finish===="); 174 try { 175 appAccountManager.createAccount(); 176 } catch(err) { 177 console.info("====>ActsAccountErrCode_0600 create account catch err:" + JSON.stringify(err)); 178 expect(err.code).assertEqual(401); 179 console.info("====>ActsAccountErrCode_0600 end===="); 180 done(); 181 } 182 }); 183 184 /* 185 * @tc.number : ActsAccountErrCode_0610 186 * @tc.name : createAccount promise 187 * @tc.desc : test the type of parameters does not match 188 */ 189 it('ActsAccountErrCode_0610', 0, async function (done) { 190 console.info("====>ActsAccountErrCode_0610 start===="); 191 var appAccountManager = account.createAppAccountManager(); 192 console.info("====>ActsAccountErrCode_0610 creat finish===="); 193 try { 194 appAccountManager.createAccount(123456); 195 } catch(err) { 196 console.info("====>ActsAccountErrCode_0610 create account catch err:" + JSON.stringify(err)); 197 expect(err.code).assertEqual(401); 198 console.info("====>ActsAccountErrCode_0610 end===="); 199 done(); 200 } 201 }); 202 203 //createAccountImplicitly 204 /* 205 * @tc.number : ActsAccountErrCode_0700 206 * @tc.name : createAccountImplicitly callback 207 * @tc.desc : test the number of parameters does not match(extrainfo不匹配) 208 */ 209 it('ActsAccountErrCode_0700', 0, async function (done) { 210 console.info("====>ActsAccountErrCode_0700 start===="); 211 var appAccountManager = account.createAppAccountManager(); 212 console.info("====>ActsAccountErrCode_0700 creat finish===="); 213 try { 214 appAccountManager.createAccountImplicitly({ 215 onResult: (resultCode, resultData)=>{ 216 console.info("====>ActsAccountErrCode_0700 authenticate resultCode:" + JSON.stringify(resultCode)); 217 console.info("====>ActsAccountErrCode_0700 authenticate resultData:" + JSON.stringify(resultData)); 218 done(); 219 }, 220 onRequestRedirected: null 221 }); 222 } catch(err) { 223 console.info("====>ActsAccountErrCode_0700 create account catch err:" + JSON.stringify(err)); 224 expect(err.code).assertEqual(401); 225 console.info("====>ActsAccountErrCode_0700 end===="); 226 done(); 227 } 228 }); 229 230 /* 231 * @tc.number : ActsAccountErrCode_0800 232 * @tc.name : createAccountImplicitly callback 233 * @tc.desc : test the type of parameters does not match(name不匹配) 234 */ 235 it('ActsAccountErrCode_0800', 0, async function (done) { 236 console.info("====>ActsAccountErrCode_0800 start===="); 237 var appAccountManager = account.createAppAccountManager(); 238 console.info("====>ActsAccountErrCode_0800 creat finish===="); 239 try { 240 appAccountManager.createAccountImplicitly(123456, {}, { 241 onResult: null, 242 onRequestRedirected: null 243 }); 244 } catch(err) { 245 console.info("====>ActsAccountErrCode_0800 create account catch err:" + JSON.stringify(err)); 246 expect(err.code).assertEqual(401); 247 console.info("====>ActsAccountErrCode_0800 end===="); 248 done(); 249 } 250 }); 251 252 /* 253 * @tc.number : ActsAccountErrCode_0810 254 * @tc.name : createAccountImplicitly callback 255 * @tc.desc : test the type of parameters does not match(options不匹配) 256 */ 257 it('ActsAccountErrCode_0810', 0, async function (done) { 258 console.info("====>ActsAccountErrCode_0810 start===="); 259 var appAccountManager = account.createAppAccountManager(); 260 console.info("====>ActsAccountErrCode_0810 creat finish===="); 261 try { 262 appAccountManager.createAccountImplicitly("test_owner", "test_options", { 263 onResult: null, 264 onRequestRedirected: null 265 }); 266 } catch(err) { 267 console.info("====>ActsAccountErrCode_0810 create account catch err:" + JSON.stringify(err)); 268 expect(err.code).assertEqual(401); 269 console.info("====>ActsAccountErrCode_0810 end===="); 270 done(); 271 } 272 }); 273 274 /* 275 * @tc.number : ActsAccountErrCode_0820 276 * @tc.name : createAccountImplicitly callback 277 * @tc.desc : test the type of parameters does not match(callback不匹配) 278 */ 279 it('ActsAccountErrCode_0820', 0, async function (done) { 280 console.info("====>ActsAccountErrCode_0820 start===="); 281 var appAccountManager = account.createAppAccountManager(); 282 console.info("====>ActsAccountErrCode_0820 creat finish===="); 283 var options = {authType: "test_authType"}; 284 try { 285 appAccountManager.createAccountImplicitly("test_owner", options, 1233); 286 } catch(err) { 287 console.info("====>ActsAccountErrCode_0820 create account catch err:" + JSON.stringify(err)); 288 expect(err.code).assertEqual(401); 289 console.info("====>ActsAccountErrCode_0820 end===="); 290 done(); 291 } 292 }); 293 294 //removeAccount 295 /* 296 * @tc.number : ActsAccountErrCode_0900 297 * @tc.name : removeAccount callback 298 * @tc.desc : test the type of parameters does not match(name不匹配) 299 */ 300 it('ActsAccountErrCode_0900', 0, async function (done) { 301 console.info("====>ActsAccountErrCode_0900 start===="); 302 var appAccountManager = account.createAppAccountManager(); 303 console.info("====>ActsAccountErrCode_0900 creat finish===="); 304 try { 305 appAccountManager.removeAccount(123456, (err)=>{ 306 console.info("====>ActsAccountErrCode_0900 remove account callback err:" + JSON.stringify(err)); 307 expect().assertFail(); 308 done(); 309 }) 310 } catch(err) { 311 console.info("====>ActsAccountErrCode_0900 remove account catch err:" + JSON.stringify(err)); 312 expect(err.code).assertEqual(401); 313 console.info("====>ActsAccountErrCode_0900 end===="); 314 done(); 315 } 316 }); 317 318 //removeAccount 319 /* 320 * @tc.number : ActsAccountErrCode_0910 321 * @tc.name : removeAccount callback 322 * @tc.desc : test the type of parameters does not match(callback不匹配) 323 */ 324 it('ActsAccountErrCode_0910', 0, async function (done) { 325 console.info("====>ActsAccountErrCode_0910 start===="); 326 var appAccountManager = account.createAppAccountManager(); 327 console.info("====>ActsAccountErrCode_0910 creat finish===="); 328 try { 329 appAccountManager.removeAccount("test_name", 1234); 330 } catch(err) { 331 console.info("====>ActsAccountErrCode_0910 remove account catch err:" + JSON.stringify(err)); 332 expect(err.code).assertEqual(401); 333 console.info("====>ActsAccountErrCode_0910 end===="); 334 done(); 335 } 336 }); 337 338 /* 339 * @tc.number : ActsAccountErrCode_1000 340 * @tc.name : removeAccount callback 341 * @tc.desc : test the number of parameters does not match 342 */ 343 it('ActsAccountErrCode_1000', 0, async function (done) { 344 console.info("====>ActsAccountErrCode_1000 start===="); 345 var appAccountManager = account.createAppAccountManager(); 346 console.info("====>ActsAccountErrCode_1000 creat finish===="); 347 try { 348 appAccountManager.removeAccount((err)=>{ 349 console.info("====>ActsAccountErrCode_1000 remove account callback err:" + JSON.stringify(err)); 350 expect().assertFail(); 351 done(); 352 }) 353 } catch(err) { 354 console.info("====>ActsAccountErrCode_1000 remove account catch err:" + JSON.stringify(err)); 355 expect(err.code).assertEqual(401); 356 console.info("====>ActsAccountErrCode_1000 end===="); 357 done(); 358 } 359 }); 360 361 /* 362 * @tc.number : ActsAccountErrCode_1100 363 * @tc.name : removeAccount promise 364 * @tc.desc : test the type of parameters does not match(name不匹配) 365 */ 366 it('ActsAccountErrCode_1100', 0, async function (done) { 367 console.info("====>ActsAccountErrCode_1100 start===="); 368 var appAccountManager = account.createAppAccountManager(); 369 console.info("====>ActsAccountErrCode_1100 creat finish===="); 370 try { 371 appAccountManager.removeAccount(123456) 372 } catch(err) { 373 console.info("====>ActsAccountErrCode_1100 remove account catch err:" + JSON.stringify(err)); 374 expect(err.code).assertEqual(401); 375 console.info("====>ActsAccountErrCode_1100 end===="); 376 done(); 377 } 378 }); 379 380 /* 381 * @tc.number : ActsAccountErrCode_1200 382 * @tc.name : removeAccount callback 383 * @tc.desc : test the number of parameters does not match 384 */ 385 it('ActsAccountErrCode_1200', 0, async function (done) { 386 console.info("====>ActsAccountErrCode_1200 start===="); 387 var appAccountManager = account.createAppAccountManager(); 388 console.info("====>ActsAccountErrCode_1200 creat finish===="); 389 try { 390 appAccountManager.removeAccount(); 391 } catch(err) { 392 console.info("====>ActsAccountErrCode_1200 remove account catch err:" + JSON.stringify(err)); 393 expect(err.code).assertEqual(401); 394 console.info("====>ActsAccountErrCode_1200 end===="); 395 done(); 396 } 397 }); 398 399 //setAppAccess 400 /* 401 * @tc.number : ActsAccountErrCode_1300 402 * @tc.name : setAppAccess callback 403 * @tc.desc : test the number of parameters does not match 404 */ 405 it('ActsAccountErrCode_1300', 0, async function (done) { 406 console.info("====>ActsAccountErrCode_1300 start===="); 407 var appAccountManager = account.createAppAccountManager(); 408 console.info("====>ActsAccountErrCode_1300 creat finish===="); 409 try { 410 appAccountManager.setAppAccess((err)=>{ 411 console.info("====>ActsAccountErrCode_1300 setAppAccess callback err:" + JSON.stringify(err)); 412 expect().assertFail(); 413 done(); 414 }) 415 } catch(err) { 416 console.info("====>ActsAccountErrCode_1300 setAppAccess catch err:" + JSON.stringify(err)); 417 expect(err.code).assertEqual(401); 418 console.info("====>ActsAccountErrCode_1300 end===="); 419 done(); 420 } 421 }); 422 423 /* 424 * @tc.number : ActsAccountErrCode_1400 425 * @tc.name : setAppAccess callback 426 * @tc.desc : test the type of parameters does not match 427 */ 428 it('ActsAccountErrCode_1400', 0, async function (done) { 429 console.info("====>ActsAccountErrCode_1400 start===="); 430 var appAccountManager = account.createAppAccountManager(); 431 console.info("====>ActsAccountErrCode_1400 creat finish===="); 432 try { 433 appAccountManager.setAppAccess(123456, "test_owner", false, (err)=>{ 434 console.info("====>ActsAccountErrCode_1400 setAppAccess callback err:" + JSON.stringify(err)); 435 expect().assertFail(); 436 done(); 437 }) 438 } catch(err) { 439 console.info("====>ActsAccountErrCode_1400 setAppAccess catch err:" + JSON.stringify(err)); 440 expect(err.code).assertEqual(401); 441 console.info("====>ActsAccountErrCode_1400 end===="); 442 done(); 443 } 444 }); 445 446 /* 447 * @tc.number : ActsAccountErrCode_1410 448 * @tc.name : setAppAccess callback 449 * @tc.desc : test the type of parameters does not match(callback不匹配) 450 */ 451 it('ActsAccountErrCode_1410', 0, async function (done) { 452 console.info("====>ActsAccountErrCode_1410 start===="); 453 var appAccountManager = account.createAppAccountManager(); 454 console.info("====>ActsAccountErrCode_1410 creat finish===="); 455 try { 456 appAccountManager.setAppAccess("test_name", "test_owner", false, 1234); 457 } catch(err) { 458 console.info("====>ActsAccountErrCode_1410 setAppAccess catch err:" + JSON.stringify(err)); 459 expect(err.code).assertEqual(401); 460 console.info("====>ActsAccountErrCode_1410 end===="); 461 done(); 462 } 463 }); 464 465 /* 466 * @tc.number : ActsAccountErrCode_1500 467 * @tc.name : setAppAccess promise 468 * @tc.desc : test the number of parameters does not match 469 */ 470 it('ActsAccountErrCode_1500', 0, async function (done) { 471 console.info("====>ActsAccountErrCode_1500 start===="); 472 var appAccountManager = account.createAppAccountManager(); 473 console.info("====>ActsAccountErrCode_1500 creat finish===="); 474 try { 475 appAccountManager.setAppAccess(); 476 } catch(err) { 477 console.info("====>ActsAccountErrCode_1500 setAppAccess catch err:" + JSON.stringify(err)); 478 expect(err.code).assertEqual(401); 479 console.info("====>ActsAccountErrCode_1500 end===="); 480 done(); 481 } 482 }); 483 484 /* 485 * @tc.number : ActsAccountErrCode_1600 486 * @tc.name : setAppAccess promise 487 * @tc.desc : test the type of parameters does not match(name不匹配) 488 */ 489 it('ActsAccountErrCode_1600', 0, async function (done) { 490 console.info("====>ActsAccountErrCode_1600 start===="); 491 var appAccountManager = account.createAppAccountManager(); 492 console.info("====>ActsAccountErrCode_1600 creat finish===="); 493 try { 494 appAccountManager.setAppAccess(123456, "test_owner", false); 495 } catch(err) { 496 console.info("====>ActsAccountErrCode_1600 setAppAccess catch err:" + JSON.stringify(err)); 497 expect(err.code).assertEqual(401); 498 console.info("====>ActsAccountErrCode_1600 end===="); 499 done(); 500 } 501 }); 502 503 /* 504 * @tc.number : ActsAccountErrCode_1610 505 * @tc.name : setAppAccess promise 506 * @tc.desc : test the type of parameters does not match(bundlename不匹配) 507 */ 508 it('ActsAccountErrCode_1610', 0, async function (done) { 509 console.info("====>ActsAccountErrCode_1610 start===="); 510 var appAccountManager = account.createAppAccountManager(); 511 console.info("====>ActsAccountErrCode_1610 creat finish===="); 512 try { 513 appAccountManager.setAppAccess("test_name", 12345, false); 514 } catch(err) { 515 console.info("====>ActsAccountErrCode_1610 setAppAccess catch err:" + JSON.stringify(err)); 516 expect(err.code).assertEqual(401); 517 console.info("====>ActsAccountErrCode_1610 end===="); 518 done(); 519 } 520 }); 521 522 /* 523 * @tc.number : ActsAccountErrCode_1620 524 * @tc.name : setAppAccess promise 525 * @tc.desc : test the type of parameters does not match(isAccessible不匹配) 526 */ 527 it('ActsAccountErrCode_1620', 0, async function (done) { 528 console.info("====>ActsAccountErrCode_1620 start===="); 529 var appAccountManager = account.createAppAccountManager(); 530 console.info("====>ActsAccountErrCode_1620 creat finish===="); 531 try { 532 appAccountManager.setAppAccess("test_name", "test_owner", "123"); 533 } catch(err) { 534 console.info("====>ActsAccountErrCode_1620 setAppAccess catch err:" + JSON.stringify(err)); 535 expect(err.code).assertEqual(401); 536 console.info("====>ActsAccountErrCode_1620 end===="); 537 done(); 538 } 539 }); 540 541 //checkDataSyncEnabled 542 /* 543 * @tc.number : ActsAccountErrCode_1700 544 * @tc.name : checkDataSyncEnabled callback 545 * @tc.desc : test the number of parameters does not match 546 */ 547 it('ActsAccountErrCode_1700', 0, async function (done) { 548 console.info("====>ActsAccountErrCode_1700 start===="); 549 var appAccountManager = account.createAppAccountManager(); 550 console.info("====>ActsAccountErrCode_1700 creat finish===="); 551 try { 552 appAccountManager.checkDataSyncEnabled((err, data)=>{ 553 console.info("====>ActsAccountErrCode_1700 checkDataSyncEnabled callback err:" + JSON.stringify(err)); 554 expect().assertFail(); 555 done(); 556 }) 557 } catch(err) { 558 console.info("====>ActsAccountErrCode_1700 checkDataSyncEnabled catch err:" + JSON.stringify(err)); 559 expect(err.code).assertEqual(401); 560 console.info("====>ActsAccountErrCode_1700 end===="); 561 done(); 562 } 563 }); 564 565 /* 566 * @tc.number : ActsAccountErrCode_1800 567 * @tc.name : checkDataSyncEnabled callback 568 * @tc.desc : test the type of parameters does not match 569 */ 570 it('ActsAccountErrCode_1800', 0, async function (done) { 571 console.info("====>ActsAccountErrCode_1800 start===="); 572 var appAccountManager = account.createAppAccountManager(); 573 console.info("====>ActsAccountErrCode_1800 creat finish===="); 574 try { 575 appAccountManager.checkDataSyncEnabled(123456, (err, data)=>{ 576 console.info("====>ActsAccountErrCode_1800 checkDataSyncEnabled callback err:" + JSON.stringify(err)); 577 expect().assertFail(); 578 done(); 579 }) 580 } catch(err) { 581 console.info("====>ActsAccountErrCode_1800 checkDataSyncEnabled catch err:" + JSON.stringify(err)); 582 expect(err.code).assertEqual(401); 583 console.info("====>ActsAccountErrCode_1800 end===="); 584 done(); 585 } 586 }); 587 588 /* 589 * @tc.number : ActsAccountErrCode_1810 590 * @tc.name : checkDataSyncEnabled callback 591 * @tc.desc : test the type of parameters does not match(callback不匹配) 592 */ 593 it('ActsAccountErrCode_1810', 0, async function (done) { 594 console.info("====>ActsAccountErrCode_1810 start===="); 595 var appAccountManager = account.createAppAccountManager(); 596 console.info("====>ActsAccountErrCode_1810 creat finish===="); 597 try { 598 appAccountManager.checkDataSyncEnabled("test_name", 123456); 599 } catch(err) { 600 console.info("====>ActsAccountErrCode_1810 checkDataSyncEnabled catch err:" + JSON.stringify(err)); 601 expect(err.code).assertEqual(401); 602 console.info("====>ActsAccountErrCode_1810 end===="); 603 done(); 604 } 605 }); 606 607 /* 608 * @tc.number : ActsAccountErrCode_1900 609 * @tc.name : checkDataSyncEnabled promise 610 * @tc.desc : test the number of parameters does not match 611 */ 612 it('ActsAccountErrCode_1900', 0, async function (done) { 613 console.info("====>ActsAccountErrCode_1900 start===="); 614 var appAccountManager = account.createAppAccountManager(); 615 console.info("====>ActsAccountErrCode_1900 creat finish===="); 616 try { 617 appAccountManager.checkDataSyncEnabled(); 618 } catch(err) { 619 console.info("====>ActsAccountErrCode_1900 checkDataSyncEnabled catch err:" + JSON.stringify(err)); 620 expect(err.code).assertEqual(401); 621 console.info("====>ActsAccountErrCode_1900 end===="); 622 done(); 623 } 624 }); 625 626 /* 627 * @tc.number : ActsAccountErrCode_2000 628 * @tc.name : checkDataSyncEnabled promise 629 * @tc.desc : test the type of parameters does not match 630 */ 631 it('ActsAccountErrCode_2000', 0, async function (done) { 632 console.info("====>ActsAccountErrCode_2000 start===="); 633 var appAccountManager = account.createAppAccountManager(); 634 console.info("====>ActsAccountErrCode_2000 creat finish===="); 635 try { 636 appAccountManager.checkDataSyncEnabled(123456); 637 } catch(err) { 638 console.info("====>ActsAccountErrCode_2000 checkDataSyncEnabled catch err:" + JSON.stringify(err)); 639 expect(err.code).assertEqual(401); 640 console.info("====>ActsAccountErrCode_2000 end===="); 641 done(); 642 } 643 }); 644 645 //setCredential 646 /* 647 * @tc.number : ActsAccountErrCode_2100 648 * @tc.name : setCredential callback 649 * @tc.desc : test the number of parameters does not match 650 */ 651 it('ActsAccountErrCode_2100', 0, async function (done) { 652 console.info("====>ActsAccountErrCode_2100 start===="); 653 var appAccountManager = account.createAppAccountManager(); 654 console.info("====>ActsAccountErrCode_2100 creat finish===="); 655 try { 656 appAccountManager.setCredential((err)=>{ 657 console.info("====>ActsAccountErrCode_2100 setCredential callback err:" + JSON.stringify(err)); 658 expect().assertFail(); 659 done(); 660 }) 661 } catch(err) { 662 console.info("====>ActsAccountErrCode_2100 setCredential catch err:" + JSON.stringify(err)); 663 expect(err.code).assertEqual(401); 664 console.info("====>ActsAccountErrCode_2100 end===="); 665 done(); 666 } 667 }); 668 669 /* 670 * @tc.number : ActsAccountErrCode_2200 671 * @tc.name : setCredential callback 672 * @tc.desc : test the type of parameters does not match 673 */ 674 it('ActsAccountErrCode_2200', 0, async function (done) { 675 console.info("====>ActsAccountErrCode_2200 start===="); 676 var appAccountManager = account.createAppAccountManager(); 677 console.info("====>ActsAccountErrCode_2200 creat finish===="); 678 try { 679 appAccountManager.setCredential(123456, "test_credential_type", "test_credential", (err)=>{ 680 console.info("====>ActsAccountErrCode_2200 setCredential callback err:" + JSON.stringify(err)); 681 expect().assertFail(); 682 done(); 683 }) 684 } catch(err) { 685 console.info("====>ActsAccountErrCode_2200 setCredential catch err:" + JSON.stringify(err)); 686 expect(err.code).assertEqual(401); 687 console.info("====>ActsAccountErrCode_2200 end===="); 688 done(); 689 } 690 }); 691 692 /* 693 * @tc.number : ActsAccountErrCode_2210 694 * @tc.name : setCredential callback 695 * @tc.desc : test the type of parameters does not match 696 */ 697 it('ActsAccountErrCode_2210', 0, async function (done) { 698 console.info("====>ActsAccountErrCode_2210 start===="); 699 var appAccountManager = account.createAppAccountManager(); 700 console.info("====>ActsAccountErrCode_2210 creat finish===="); 701 try { 702 appAccountManager.setCredential("test_name", "test_credential_type", "test_credential", 1234); 703 } catch(err) { 704 console.info("====>ActsAccountErrCode_2210 setCredential catch err:" + JSON.stringify(err)); 705 expect(err.code).assertEqual(401); 706 console.info("====>ActsAccountErrCode_2210 end===="); 707 done(); 708 } 709 }); 710 711 /* 712 * @tc.number : ActsAccountErrCode_2300 713 * @tc.name : setCredential promise 714 * @tc.desc : test the number of parameters does not match 715 */ 716 it('ActsAccountErrCode_2300', 0, async function (done) { 717 console.info("====>ActsAccountErrCode_2300 start===="); 718 var appAccountManager = account.createAppAccountManager(); 719 console.info("====>ActsAccountErrCode_2300 creat finish===="); 720 try { 721 appAccountManager.setCredential(); 722 } catch(err) { 723 console.info("====>ActsAccountErrCode_2300 setCredential catch err:" + JSON.stringify(err)); 724 expect(err.code).assertEqual(401); 725 console.info("====>ActsAccountErrCode_2300 end===="); 726 done(); 727 } 728 }); 729 730 /* 731 * @tc.number : ActsAccountErrCode_2400 732 * @tc.name : setCredential promise 733 * @tc.desc : test the type of parameters does not match(name不匹配) 734 */ 735 it('ActsAccountErrCode_2400', 0, async function (done) { 736 console.info("====>ActsAccountErrCode_2400 start===="); 737 var appAccountManager = account.createAppAccountManager(); 738 console.info("====>ActsAccountErrCode_2400 creat finish===="); 739 try { 740 appAccountManager.setCredential(123456, "test_credential_type", "test_credential"); 741 } catch(err) { 742 console.info("====>ActsAccountErrCode_2400 setCredential catch err:" + JSON.stringify(err)); 743 expect(err.code).assertEqual(401); 744 console.info("====>ActsAccountErrCode_2400 end===="); 745 done(); 746 } 747 }); 748 749 /* 750 * @tc.number : ActsAccountErrCode_2410 751 * @tc.name : setCredential promise 752 * @tc.desc : test the type of parameters does not match(credentialType不匹配) 753 */ 754 it('ActsAccountErrCode_2410', 0, async function (done) { 755 console.info("====>ActsAccountErrCode_2410 start===="); 756 var appAccountManager = account.createAppAccountManager(); 757 console.info("====>ActsAccountErrCode_2410 creat finish===="); 758 try { 759 appAccountManager.setCredential("test_name", 12345, "test_credential"); 760 } catch(err) { 761 console.info("====>ActsAccountErrCode_2410 setCredential catch err:" + JSON.stringify(err)); 762 expect(err.code).assertEqual(401); 763 console.info("====>ActsAccountErrCode_2410 end===="); 764 done(); 765 } 766 }); 767 768 /* 769 * @tc.number : ActsAccountErrCode_2420 770 * @tc.name : setCredential promise 771 * @tc.desc : test the type of parameters does not match(credential不匹配) 772 */ 773 it('ActsAccountErrCode_2420', 0, async function (done) { 774 console.info("====>ActsAccountErrCode_2420 start===="); 775 var appAccountManager = account.createAppAccountManager(); 776 console.info("====>ActsAccountErrCode_2420 creat finish===="); 777 try { 778 appAccountManager.setCredential("test_name", "test_credential_type", 12345); 779 } catch(err) { 780 console.info("====>ActsAccountErrCode_2420 setCredential catch err:" + JSON.stringify(err)); 781 expect(err.code).assertEqual(401); 782 console.info("====>ActsAccountErrCode_2420 end===="); 783 done(); 784 } 785 }); 786 787 //setDataSyncEnabled 788 /* 789 * @tc.number : ActsAccountErrCode_2500 790 * @tc.name : setDataSyncEnabled callback 791 * @tc.desc : test the number of parameters does not match 792 */ 793 it('ActsAccountErrCode_2500', 0, async function (done) { 794 console.info("====>ActsAccountErrCode_2500 start===="); 795 var appAccountManager = account.createAppAccountManager(); 796 console.info("====>ActsAccountErrCode_2500 creat finish===="); 797 try { 798 appAccountManager.setDataSyncEnabled((err)=>{ 799 console.info("====>ActsAccountErrCode_2500 setDataSyncEnabled callback err:" + JSON.stringify(err)); 800 expect().assertFail(); 801 done(); 802 }) 803 } catch(err) { 804 console.info("====>ActsAccountErrCode_2500 setDataSyncEnabled catch err:" + JSON.stringify(err)); 805 expect(err.code).assertEqual(401); 806 console.info("====>ActsAccountErrCode_2500 end===="); 807 done(); 808 } 809 }); 810 811 /* 812 * @tc.number : ActsAccountErrCode_2600 813 * @tc.name : setDataSyncEnabled callback 814 * @tc.desc : test the type of parameters does not match 815 */ 816 it('ActsAccountErrCode_2600', 0, async function (done) { 817 console.info("====>ActsAccountErrCode_2600 start===="); 818 var appAccountManager = account.createAppAccountManager(); 819 console.info("====>ActsAccountErrCode_2600 creat finish===="); 820 try { 821 appAccountManager.setDataSyncEnabled(123456, false, (err)=>{ 822 console.info("====>ActsAccountErrCode_2600 setDataSyncEnabled callback err:" + JSON.stringify(err)); 823 expect().assertFail(); 824 done(); 825 }) 826 } catch(err) { 827 console.info("====>ActsAccountErrCode_2600 setDataSyncEnabled catch err:" + JSON.stringify(err)); 828 expect(err.code).assertEqual(401); 829 console.info("====>ActsAccountErrCode_2600 end===="); 830 done(); 831 } 832 }); 833 834 /* 835 * @tc.number : ActsAccountErrCode_2610 836 * @tc.name : setDataSyncEnabled callback 837 * @tc.desc : test the type of parameters does not match(callback不匹配) 838 */ 839 it('ActsAccountErrCode_2610', 0, async function (done) { 840 console.info("====>ActsAccountErrCode_2610 start===="); 841 var appAccountManager = account.createAppAccountManager(); 842 console.info("====>ActsAccountErrCode_2610 creat finish===="); 843 try { 844 appAccountManager.setDataSyncEnabled("test_name", false, 1234); 845 } catch(err) { 846 console.info("====>ActsAccountErrCode_2610 setDataSyncEnabled catch err:" + JSON.stringify(err)); 847 expect(err.code).assertEqual(401); 848 console.info("====>ActsAccountErrCode_2610 end===="); 849 done(); 850 } 851 }); 852 853 /* 854 * @tc.number : ActsAccountErrCode_2700 855 * @tc.name : setDataSyncEnabled promise 856 * @tc.desc : test the number of parameters does not match 857 */ 858 it('ActsAccountErrCode_2700', 0, async function (done) { 859 console.info("====>ActsAccountErrCode_2700 start===="); 860 var appAccountManager = account.createAppAccountManager(); 861 console.info("====>ActsAccountErrCode_2700 creat finish===="); 862 try { 863 appAccountManager.setDataSyncEnabled(); 864 } catch(err) { 865 console.info("====>ActsAccountErrCode_2700 setDataSyncEnabled catch err:" + JSON.stringify(err)); 866 expect(err.code).assertEqual(401); 867 console.info("====>ActsAccountErrCode_2700 end===="); 868 done(); 869 } 870 }); 871 872 /* 873 * @tc.number : ActsAccountErrCode_2800 874 * @tc.name : setDataSyncEnabled promise 875 * @tc.desc : test the type of parameters does not match(name不匹配) 876 */ 877 it('ActsAccountErrCode_2800', 0, async function (done) { 878 console.info("====>ActsAccountErrCode_2800 start===="); 879 var appAccountManager = account.createAppAccountManager(); 880 console.info("====>ActsAccountErrCode_2800 creat finish===="); 881 try { 882 appAccountManager.setDataSyncEnabled(123456, false); 883 } catch(err) { 884 console.info("====>ActsAccountErrCode_2800 setDataSyncEnabled catch err:" + JSON.stringify(err)); 885 expect(err.code).assertEqual(401); 886 console.info("====>ActsAccountErrCode_2800 end===="); 887 done(); 888 } 889 }); 890 891 /* 892 * @tc.number : ActsAccountErrCode_2810 893 * @tc.name : setDataSyncEnabled promise 894 * @tc.desc : test the type of parameters does not match(isEnable不匹配) 895 */ 896 it('ActsAccountErrCode_2810', 0, async function (done) { 897 console.info("====>ActsAccountErrCode_2810 start===="); 898 var appAccountManager = account.createAppAccountManager(); 899 console.info("====>ActsAccountErrCode_2810 creat finish===="); 900 try { 901 appAccountManager.setDataSyncEnabled("test_name", "false"); 902 } catch(err) { 903 console.info("====>ActsAccountErrCode_2810 setDataSyncEnabled catch err:" + JSON.stringify(err)); 904 expect(err.code).assertEqual(401); 905 console.info("====>ActsAccountErrCode_2810 end===="); 906 done(); 907 } 908 }); 909 910 //setCustomData 911 /* 912 * @tc.number : ActsAccountErrCode_2900 913 * @tc.name : setCustomData callback 914 * @tc.desc : test the number of parameters does not match 915 */ 916 it('ActsAccountErrCode_2900', 0, async function (done) { 917 console.info("====>ActsAccountErrCode_2900 start===="); 918 var appAccountManager = account.createAppAccountManager(); 919 console.info("====>ActsAccountErrCode_2900 creat finish===="); 920 try { 921 appAccountManager.setCustomData((err)=>{ 922 console.info("====>ActsAccountErrCode_2900 setCustomData callback err:" + JSON.stringify(err)); 923 expect().assertFail(); 924 done(); 925 }) 926 } catch(err) { 927 console.info("====>ActsAccountErrCode_2900 setCustomData catch err:" + JSON.stringify(err)); 928 expect(err.code).assertEqual(401); 929 console.info("====>ActsAccountErrCode_2900 end===="); 930 done(); 931 } 932 }); 933 934 /* 935 * @tc.number : ActsAccountErrCode_3000 936 * @tc.name : setCustomData callback 937 * @tc.desc : test the type of parameters does not match 938 */ 939 it('ActsAccountErrCode_3000', 0, async function (done) { 940 console.info("====>ActsAccountErrCode_3000 start===="); 941 var appAccountManager = account.createAppAccountManager(); 942 console.info("====>ActsAccountErrCode_3000 creat finish===="); 943 try { 944 appAccountManager.setCustomData(123456, "test_key", "test_value", (err)=>{ 945 console.info("====>ActsAccountErrCode_3000 setCustomData callback err:" + JSON.stringify(err)); 946 expect().assertFail(); 947 done(); 948 }) 949 } catch(err) { 950 console.info("====>ActsAccountErrCode_3000 setCustomData catch err:" + JSON.stringify(err)); 951 expect(err.code).assertEqual(401); 952 console.info("====>ActsAccountErrCode_3000 end===="); 953 done(); 954 } 955 }); 956 957 /* 958 * @tc.number : ActsAccountErrCode_3010 959 * @tc.name : setCustomData callback 960 * @tc.desc : test the type of parameters does not match(callback不匹配) 961 */ 962 it('ActsAccountErrCode_3010', 0, async function (done) { 963 console.info("====>ActsAccountErrCode_3010 start===="); 964 var appAccountManager = account.createAppAccountManager(); 965 console.info("====>ActsAccountErrCode_3010 creat finish===="); 966 try { 967 appAccountManager.setCustomData("test_name", "test_key", "test_value", 1234); 968 } catch(err) { 969 console.info("====>ActsAccountErrCode_3010 setCustomData catch err:" + JSON.stringify(err)); 970 expect(err.code).assertEqual(401); 971 console.info("====>ActsAccountErrCode_3010 end===="); 972 done(); 973 } 974 }); 975 976 /* 977 * @tc.number : ActsAccountErrCode_3100 978 * @tc.name : setCustomData promise 979 * @tc.desc : test the number of parameters does not match 980 */ 981 it('ActsAccountErrCode_3100', 0, async function (done) { 982 console.info("====>ActsAccountErrCode_3100 start===="); 983 var appAccountManager = account.createAppAccountManager(); 984 console.info("====>ActsAccountErrCode_3100 creat finish===="); 985 try { 986 appAccountManager.setCustomData(); 987 } catch(err) { 988 console.info("====>ActsAccountErrCode_3100 setCustomData catch err:" + JSON.stringify(err)); 989 expect(err.code).assertEqual(401); 990 console.info("====>ActsAccountErrCode_3100 end===="); 991 done(); 992 } 993 }); 994 995 /* 996 * @tc.number : ActsAccountErrCode_3200 997 * @tc.name : setCustomData promise 998 * @tc.desc : test the type of parameters does not match(name不匹配) 999 */ 1000 it('ActsAccountErrCode_3200', 0, async function (done) { 1001 console.info("====>ActsAccountErrCode_3200 start===="); 1002 var appAccountManager = account.createAppAccountManager(); 1003 console.info("====>ActsAccountErrCode_3200 creat finish===="); 1004 try { 1005 appAccountManager.setCustomData(123456, "test_key", "test_value"); 1006 } catch(err) { 1007 console.info("====>ActsAccountErrCode_3200 setCustomData catch err:" + JSON.stringify(err)); 1008 expect(err.code).assertEqual(401); 1009 console.info("====>ActsAccountErrCode_3200 end===="); 1010 done(); 1011 } 1012 }); 1013 1014 /* 1015 * @tc.number : ActsAccountErrCode_3210 1016 * @tc.name : setCustomData promise 1017 * @tc.desc : test the type of parameters does not match(key不匹配) 1018 */ 1019 it('ActsAccountErrCode_3210', 0, async function (done) { 1020 console.info("====>ActsAccountErrCode_3210 start===="); 1021 var appAccountManager = account.createAppAccountManager(); 1022 console.info("====>ActsAccountErrCode_3210 creat finish===="); 1023 try { 1024 appAccountManager.setCustomData("test_name", 12345, "test_value"); 1025 } catch(err) { 1026 console.info("====>ActsAccountErrCode_3210 setCustomData catch err:" + JSON.stringify(err)); 1027 expect(err.code).assertEqual(401); 1028 console.info("====>ActsAccountErrCode_3210 end===="); 1029 done(); 1030 } 1031 }); 1032 1033 /* 1034 * @tc.number : ActsAccountErrCode_3220 1035 * @tc.name : setCustomData promise 1036 * @tc.desc : test the type of parameters does not match(value不匹配) 1037 */ 1038 it('ActsAccountErrCode_3220', 0, async function (done) { 1039 console.info("====>ActsAccountErrCode_3220 start===="); 1040 var appAccountManager = account.createAppAccountManager(); 1041 console.info("====>ActsAccountErrCode_3220 creat finish===="); 1042 try { 1043 appAccountManager.setCustomData("test_name", "test_key", 12345); 1044 } catch(err) { 1045 console.info("====>ActsAccountErrCode_3220 setCustomData catch err:" + JSON.stringify(err)); 1046 expect(err.code).assertEqual(401); 1047 console.info("====>ActsAccountErrCode_3220 end===="); 1048 done(); 1049 } 1050 }); 1051 1052 //getAllAccounts 1053 /* 1054 * @tc.number : ActsAccountErrCode_3300 1055 * @tc.name : getAllAccounts callback 1056 * @tc.desc : test the type of parameters does not match 1057 */ 1058 1059 //getAccountsByOwner 1060 /* 1061 * @tc.number : ActsAccountErrCode_3500 1062 * @tc.name : getAccountsByOwner callback 1063 * @tc.desc : test the number of parameters does not match 1064 */ 1065 it('ActsAccountErrCode_3500', 0, async function (done) { 1066 console.info("====>ActsAccountErrCode_3500 start===="); 1067 var appAccountManager = account.createAppAccountManager(); 1068 console.info("====>ActsAccountErrCode_3500 creat finish===="); 1069 try { 1070 appAccountManager.getAccountsByOwner((err, data)=>{ 1071 console.info("====>ActsAccountErrCode_3500 getAccountsByOwner callback err:" + JSON.stringify(err)); 1072 expect().assertFail(); 1073 done(); 1074 }) 1075 } catch(err) { 1076 console.info("====>ActsAccountErrCode_3500 getAccountsByOwner catch err:" + JSON.stringify(err)); 1077 expect(err.code).assertEqual(401); 1078 console.info("====>ActsAccountErrCode_3500 end===="); 1079 done(); 1080 } 1081 }); 1082 1083 /* 1084 * @tc.number : ActsAccountErrCode_3600 1085 * @tc.name : getAccountsByOwner callback 1086 * @tc.desc : test the type of parameters does not match 1087 */ 1088 it('ActsAccountErrCode_3600', 0, async function (done) { 1089 console.info("====>ActsAccountErrCode_3600 start===="); 1090 var appAccountManager = account.createAppAccountManager(); 1091 console.info("====>ActsAccountErrCode_3600 creat finish===="); 1092 try { 1093 appAccountManager.getAccountsByOwner(123456, (err, data)=>{ 1094 console.info("====>ActsAccountErrCode_3600 getAccountsByOwner callback err:" + JSON.stringify(err)); 1095 expect().assertFail(); 1096 done(); 1097 }) 1098 } catch(err) { 1099 console.info("====>ActsAccountErrCode_3600 getAccountsByOwner catch err:" + JSON.stringify(err)); 1100 expect(err.code).assertEqual(401); 1101 console.info("====>ActsAccountErrCode_3600 end===="); 1102 done(); 1103 } 1104 }); 1105 1106 /* 1107 * @tc.number : ActsAccountErrCode_3610 1108 * @tc.name : getAccountsByOwner callback 1109 * @tc.desc : test the type of parameters does not match 1110 */ 1111 it('ActsAccountErrCode_3610', 0, async function (done) { 1112 console.info("====>ActsAccountErrCode_3610 start===="); 1113 var appAccountManager = account.createAppAccountManager(); 1114 console.info("====>ActsAccountErrCode_3610 creat finish===="); 1115 try { 1116 appAccountManager.getAccountsByOwner("test_owner", 1234) 1117 } catch(err) { 1118 console.info("====>ActsAccountErrCode_3610 getAccountsByOwner catch err:" + JSON.stringify(err)); 1119 expect(err.code).assertEqual(401); 1120 console.info("====>ActsAccountErrCode_3610 end===="); 1121 done(); 1122 } 1123 }); 1124 1125 /* 1126 * @tc.number : ActsAccountErrCode_3700 1127 * @tc.name : getAccountsByOwner promise 1128 * @tc.desc : test the number of parameters does not match 1129 */ 1130 it('ActsAccountErrCode_3700', 0, async function (done) { 1131 console.info("====>ActsAccountErrCode_3700 start===="); 1132 var appAccountManager = account.createAppAccountManager(); 1133 console.info("====>ActsAccountErrCode_3700 creat finish===="); 1134 try { 1135 appAccountManager.getAccountsByOwner(); 1136 } catch(err) { 1137 console.info("====>ActsAccountErrCode_3700 getAccountsByOwner catch err:" + JSON.stringify(err)); 1138 expect(err.code).assertEqual(401); 1139 console.info("====>ActsAccountErrCode_3700 end===="); 1140 done(); 1141 } 1142 }); 1143 1144 /* 1145 * @tc.number : ActsAccountErrCode_3800 1146 * @tc.name : getAccountsByOwner promise 1147 * @tc.desc : test the type of parameters does not match 1148 */ 1149 it('ActsAccountErrCode_3800', 0, async function (done) { 1150 console.info("====>ActsAccountErrCode_3800 start===="); 1151 var appAccountManager = account.createAppAccountManager(); 1152 console.info("====>ActsAccountErrCode_3800 creat finish===="); 1153 try { 1154 appAccountManager.getAccountsByOwner(123456); 1155 } catch(err) { 1156 console.info("====>ActsAccountErrCode_3800 getAccountsByOwner catch err:" + JSON.stringify(err)); 1157 expect(err.code).assertEqual(401); 1158 console.info("====>ActsAccountErrCode_3800 end===="); 1159 done(); 1160 } 1161 }); 1162 1163 //getCredential 1164 /* 1165 * @tc.number : ActsAccountErrCode_3900 1166 * @tc.name : getCredential callback 1167 * @tc.desc : test the number of parameters does not match 1168 */ 1169 it('ActsAccountErrCode_3900', 0, async function (done) { 1170 console.info("====>ActsAccountErrCode_3900 start===="); 1171 var appAccountManager = account.createAppAccountManager(); 1172 console.info("====>ActsAccountErrCode_3900 creat finish===="); 1173 try { 1174 appAccountManager.getCredential((err, data)=>{ 1175 console.info("====>ActsAccountErrCode_3900 getCredential callback err:" + JSON.stringify(err)); 1176 expect().assertFail(); 1177 done(); 1178 }) 1179 } catch(err) { 1180 console.info("====>ActsAccountErrCode_3900 getCredential catch err:" + JSON.stringify(err)); 1181 expect(err.code).assertEqual(401); 1182 console.info("====>ActsAccountErrCode_3900 end===="); 1183 done(); 1184 } 1185 }); 1186 1187 /* 1188 * @tc.number : ActsAccountErrCode_4000 1189 * @tc.name : getCredential callback 1190 * @tc.desc : test the type of parameters does not match 1191 */ 1192 it('ActsAccountErrCode_4000', 0, async function (done) { 1193 console.info("====>ActsAccountErrCode_4000 start===="); 1194 var appAccountManager = account.createAppAccountManager(); 1195 console.info("====>ActsAccountErrCode_4000 creat finish===="); 1196 try { 1197 appAccountManager.getCredential(123456, "test_credential_type", (err, data)=>{ 1198 console.info("====>ActsAccountErrCode_4000 getCredential callback err:" + JSON.stringify(err)); 1199 expect().assertFail(); 1200 done(); 1201 }) 1202 } catch(err) { 1203 console.info("====>ActsAccountErrCode_4000 getCredential catch err:" + JSON.stringify(err)); 1204 expect(err.code).assertEqual(401); 1205 console.info("====>ActsAccountErrCode_4000 end===="); 1206 done(); 1207 } 1208 }); 1209 1210 /* 1211 * @tc.number : ActsAccountErrCode_4010 1212 * @tc.name : getCredential callback 1213 * @tc.desc : test the type of parameters does not match 1214 */ 1215 it('ActsAccountErrCode_4010', 0, async function (done) { 1216 console.info("====>ActsAccountErrCode_4010 start===="); 1217 var appAccountManager = account.createAppAccountManager(); 1218 console.info("====>ActsAccountErrCode_4010 creat finish===="); 1219 try { 1220 appAccountManager.getCredential("test_name", "test_credential_type", 1234); 1221 } catch(err) { 1222 console.info("====>ActsAccountErrCode_4010 getCredential catch err:" + JSON.stringify(err)); 1223 expect(err.code).assertEqual(401); 1224 console.info("====>ActsAccountErrCode_4010 end===="); 1225 done(); 1226 } 1227 }); 1228 1229 /* 1230 * @tc.number : ActsAccountErrCode_4100 1231 * @tc.name : getCredential promise 1232 * @tc.desc : test the number of parameters does not match 1233 */ 1234 it('ActsAccountErrCode_4100', 0, async function (done) { 1235 console.info("====>ActsAccountErrCode_4100 start===="); 1236 var appAccountManager = account.createAppAccountManager(); 1237 console.info("====>ActsAccountErrCode_4100 creat finish===="); 1238 try { 1239 appAccountManager.getCredential(); 1240 } catch(err) { 1241 console.info("====>ActsAccountErrCode_4100 getCredential catch err:" + JSON.stringify(err)); 1242 expect(err.code).assertEqual(401); 1243 console.info("====>ActsAccountErrCode_4100 end===="); 1244 done(); 1245 } 1246 }); 1247 1248 /* 1249 * @tc.number : ActsAccountErrCode_4200 1250 * @tc.name : getCredential promise 1251 * @tc.desc : test the type of parameters does not match(name不匹配) 1252 */ 1253 it('ActsAccountErrCode_4200', 0, async function (done) { 1254 console.info("====>ActsAccountErrCode_4200 start===="); 1255 var appAccountManager = account.createAppAccountManager(); 1256 console.info("====>ActsAccountErrCode_4200 creat finish===="); 1257 try { 1258 appAccountManager.getCredential(123456, "test_credential_type"); 1259 } catch(err) { 1260 console.info("====>ActsAccountErrCode_4200 getCredential catch err:" + JSON.stringify(err)); 1261 expect(err.code).assertEqual(401); 1262 console.info("====>ActsAccountErrCode_4200 end===="); 1263 done(); 1264 } 1265 }); 1266 1267 /* 1268 * @tc.number : ActsAccountErrCode_4210 1269 * @tc.name : getCredential promise 1270 * @tc.desc : test the type of parameters does not match(credentialType不匹配) 1271 */ 1272 it('ActsAccountErrCode_4210', 0, async function (done) { 1273 console.info("====>ActsAccountErrCode_4210 start===="); 1274 var appAccountManager = account.createAppAccountManager(); 1275 console.info("====>ActsAccountErrCode_4210 creat finish===="); 1276 try { 1277 appAccountManager.getCredential("test_name", 12345); 1278 } catch(err) { 1279 console.info("====>ActsAccountErrCode_4210 getCredential catch err:" + JSON.stringify(err)); 1280 expect(err.code).assertEqual(401); 1281 console.info("====>ActsAccountErrCode_4210 end===="); 1282 done(); 1283 } 1284 }); 1285 1286 //getCustomData 1287 /* 1288 * @tc.number : ActsAccountErrCode_4300 1289 * @tc.name : getCustomData callback 1290 * @tc.desc : test the number of parameters does not match 1291 */ 1292 it('ActsAccountErrCode_4300', 0, async function (done) { 1293 console.info("====>ActsAccountErrCode_4300 start===="); 1294 var appAccountManager = account.createAppAccountManager(); 1295 console.info("====>ActsAccountErrCode_4300 creat finish===="); 1296 try { 1297 appAccountManager.getCustomData((err, data)=>{ 1298 console.info("====>ActsAccountErrCode_4300 getCustomData callback err:" + JSON.stringify(err)); 1299 expect().assertFail(); 1300 done(); 1301 }) 1302 } catch(err) { 1303 console.info("====>ActsAccountErrCode_4300 getCustomData catch err:" + JSON.stringify(err)); 1304 expect(err.code).assertEqual(401); 1305 console.info("====>ActsAccountErrCode_4300 end===="); 1306 done(); 1307 } 1308 }); 1309 1310 /* 1311 * @tc.number : ActsAccountErrCode_4400 1312 * @tc.name : getCustomData callback 1313 * @tc.desc : test the type of parameters does not match 1314 */ 1315 it('ActsAccountErrCode_4400', 0, async function (done) { 1316 console.info("====>ActsAccountErrCode_4400 start===="); 1317 var appAccountManager = account.createAppAccountManager(); 1318 console.info("====>ActsAccountErrCode_4400 creat finish===="); 1319 try { 1320 appAccountManager.getCustomData(123456, "test_key", (err, data)=>{ 1321 console.info("====>ActsAccountErrCode_4400 getCustomData callback err:" + JSON.stringify(err)); 1322 expect().assertFail(); 1323 done(); 1324 }) 1325 } catch(err) { 1326 console.info("====>ActsAccountErrCode_4400 getCustomData catch err:" + JSON.stringify(err)); 1327 expect(err.code).assertEqual(401); 1328 console.info("====>ActsAccountErrCode_4400 end===="); 1329 done(); 1330 } 1331 }); 1332 1333 /* 1334 * @tc.number : ActsAccountErrCode_4410 1335 * @tc.name : getCustomData callback 1336 * @tc.desc : test the type of parameters does not match 1337 */ 1338 it('ActsAccountErrCode_4410', 0, async function (done) { 1339 console.info("====>ActsAccountErrCode_4410 start===="); 1340 var appAccountManager = account.createAppAccountManager(); 1341 console.info("====>ActsAccountErrCode_4410 creat finish===="); 1342 try { 1343 appAccountManager.getCustomData("test_name", "test_key", 1234); 1344 } catch(err) { 1345 console.info("====>ActsAccountErrCode_4410 getCustomData catch err:" + JSON.stringify(err)); 1346 expect(err.code).assertEqual(401); 1347 console.info("====>ActsAccountErrCode_4410 end===="); 1348 done(); 1349 } 1350 }); 1351 1352 /* 1353 * @tc.number : ActsAccountErrCode_4500 1354 * @tc.name : getCustomData promise 1355 * @tc.desc : test the number of parameters does not match 1356 */ 1357 it('ActsAccountErrCode_4500', 0, async function (done) { 1358 console.info("====>ActsAccountErrCode_4500 start===="); 1359 var appAccountManager = account.createAppAccountManager(); 1360 console.info("====>ActsAccountErrCode_4500 creat finish===="); 1361 try { 1362 appAccountManager.getCustomData(); 1363 } catch(err) { 1364 console.info("====>ActsAccountErrCode_4500 getCustomData catch err:" + JSON.stringify(err)); 1365 expect(err.code).assertEqual(401); 1366 console.info("====>ActsAccountErrCode_4500 end===="); 1367 done(); 1368 } 1369 }); 1370 1371 /* 1372 * @tc.number : ActsAccountErrCode_4600 1373 * @tc.name : getCustomData promise 1374 * @tc.desc : test the type of parameters does not match(name不匹配) 1375 */ 1376 it('ActsAccountErrCode_4600', 0, async function (done) { 1377 console.info("====>ActsAccountErrCode_4600 start===="); 1378 var appAccountManager = account.createAppAccountManager(); 1379 console.info("====>ActsAccountErrCode_4600 creat finish===="); 1380 try { 1381 appAccountManager.getCustomData(123456, "test_key"); 1382 } catch(err) { 1383 console.info("====>ActsAccountErrCode_4600 getCustomData catch err:" + JSON.stringify(err)); 1384 expect(err.code).assertEqual(401); 1385 console.info("====>ActsAccountErrCode_4600 end===="); 1386 done(); 1387 } 1388 }); 1389 1390 /* 1391 * @tc.number : ActsAccountErrCode_4610 1392 * @tc.name : getCustomData promise 1393 * @tc.desc : test the type of parameters does not match(key不匹配) 1394 */ 1395 it('ActsAccountErrCode_4610', 0, async function (done) { 1396 console.info("====>ActsAccountErrCode_4610 start===="); 1397 var appAccountManager = account.createAppAccountManager(); 1398 console.info("====>ActsAccountErrCode_4610 creat finish===="); 1399 try { 1400 appAccountManager.getCustomData("test_name", 12345); 1401 } catch(err) { 1402 console.info("====>ActsAccountErrCode_4610 getCustomData catch err:" + JSON.stringify(err)); 1403 expect(err.code).assertEqual(401); 1404 console.info("====>ActsAccountErrCode_4610 end===="); 1405 done(); 1406 } 1407 }); 1408 1409 1410 //getCustomDataSync 1411 /* 1412 * @tc.number : ActsAccountErrCode_4700 1413 * @tc.name : getCustomDataSync 1414 * @tc.desc : test the type of parameters does not match(name不匹配) 1415 */ 1416 it('ActsAccountErrCode_4700', 0, async function (done) { 1417 console.info("====>ActsAccountErrCode_4700 start===="); 1418 var appAccountManager = account.createAppAccountManager(); 1419 console.info("====>ActsAccountErrCode_4700 creat finish===="); 1420 try { 1421 appAccountManager.getCustomDataSync(123456, "test_key"); 1422 } catch(err) { 1423 console.info("====>ActsAccountErrCode_4700 getCustomDataSync catch err:" + JSON.stringify(err)); 1424 expect(err.code).assertEqual(401); 1425 console.info("====>ActsAccountErrCode_4700 end===="); 1426 done(); 1427 } 1428 }); 1429 1430 /* 1431 * @tc.number : ActsAccountErrCode_4710 1432 * @tc.name : getCustomDataSync 1433 * @tc.desc : test the type of parameters does not match(key不匹配) 1434 */ 1435 it('ActsAccountErrCode_4710', 0, async function (done) { 1436 console.info("====>ActsAccountErrCode_4710 start===="); 1437 var appAccountManager = account.createAppAccountManager(); 1438 console.info("====>ActsAccountErrCode_4710 creat finish===="); 1439 try { 1440 appAccountManager.getCustomDataSync("test_name", 12345); 1441 } catch(err) { 1442 console.info("====>ActsAccountErrCode_4710 getCustomDataSync catch err:" + JSON.stringify(err)); 1443 expect(err.code).assertEqual(401); 1444 console.info("====>ActsAccountErrCode_4710 end===="); 1445 done(); 1446 } 1447 }); 1448 1449 /* 1450 * @tc.number : ActsAccountErrCode_4800 1451 * @tc.name : getCustomDataSync 1452 * @tc.desc : test the number of parameters does not match 1453 */ 1454 it('ActsAccountErrCode_4800', 0, async function (done) { 1455 console.info("====>ActsAccountErrCode_4800 start===="); 1456 var appAccountManager = account.createAppAccountManager(); 1457 console.info("====>ActsAccountErrCode_4800 creat finish===="); 1458 try { 1459 appAccountManager.getCustomDataSync(); 1460 } catch(err) { 1461 console.info("====>ActsAccountErrCode_4800 getCustomDataSync catch err:" + JSON.stringify(err)); 1462 expect(err.code).assertEqual(401); 1463 console.info("====>ActsAccountErrCode_4800 end===="); 1464 done(); 1465 } 1466 }); 1467 1468 /* 1469 * @tc.number : ActsAccountErrCode_4900 1470 * @tc.name : getCustomDataSync 1471 * @tc.desc : test service error 1472 */ 1473 it('ActsAccountErrCode_4900', 0, async function (done) { 1474 console.info("====>ActsAccountErrCode_4900 start===="); 1475 var appAccountManager = account.createAppAccountManager(); 1476 console.info("====>ActsAccountErrCode_4900 creat finish===="); 1477 try { 1478 appAccountManager.getCustomDataSync("test_no_account", "test_key"); 1479 } catch(err) { 1480 console.info("====>ActsAccountErrCode_4900 getCustomDataSync catch err:" + JSON.stringify(err)); 1481 expect(err.code).assertEqual(12300003); 1482 console.info("====>ActsAccountErrCode_4900 end===="); 1483 done(); 1484 } 1485 }); 1486 1487 //auth 1488 /* 1489 * @tc.number : ActsAccountErrCode_5000 1490 * @tc.name : auth callback 1491 * @tc.desc : test the number of parameters does not match 1492 */ 1493 it('ActsAccountErrCode_5000', 0, async function (done) { 1494 console.info("====>ActsAccountErrCode_5000 start===="); 1495 var appAccountManager = account.createAppAccountManager(); 1496 console.info("====>ActsAccountErrCode_5000 creat finish===="); 1497 try { 1498 appAccountManager.auth("test_name"); 1499 } catch(err) { 1500 console.info("====>ActsAccountErrCode_5000 auth catch err:" + JSON.stringify(err)); 1501 expect(err.code).assertEqual(401); 1502 console.info("====>ActsAccountErrCode_5000 end===="); 1503 done(); 1504 } 1505 }); 1506 1507 /* 1508 * @tc.number : ActsAccountErrCode_5100 1509 * @tc.name : auth callback 1510 * @tc.desc : test the type of parameters does not match(name不匹配) 1511 */ 1512 it('ActsAccountErrCode_5100', 0, async function (done) { 1513 console.info("====>ActsAccountErrCode_5100 start===="); 1514 var appAccountManager = account.createAppAccountManager(); 1515 console.info("====>ActsAccountErrCode_5100 creat finish===="); 1516 try { 1517 appAccountManager.auth(12346, "test_owner", "test_authtype", { 1518 onResult: null, 1519 onRequestRedirected: null 1520 }) 1521 } catch(err) { 1522 console.info("====>ActsAccountErrCode_5100 auth catch err:" + JSON.stringify(err)); 1523 expect(err.code).assertEqual(401); 1524 console.info("====>ActsAccountErrCode_5100 end===="); 1525 done(); 1526 } 1527 }); 1528 1529 /* 1530 * @tc.number : ActsAccountErrCode_5110 1531 * @tc.name : auth callback 1532 * @tc.desc : test the type of parameters does not match(owner不匹配) 1533 */ 1534 it('ActsAccountErrCode_5110', 0, async function (done) { 1535 console.info("====>ActsAccountErrCode_5110 start===="); 1536 var appAccountManager = account.createAppAccountManager(); 1537 console.info("====>ActsAccountErrCode_5110 creat finish===="); 1538 try { 1539 appAccountManager.auth("test_name", 12346, "test_authtype", { 1540 onResult: null, 1541 onRequestRedirected: null 1542 }) 1543 } catch(err) { 1544 console.info("====>ActsAccountErrCode_5110 auth catch err:" + JSON.stringify(err)); 1545 expect(err.code).assertEqual(401); 1546 console.info("====>ActsAccountErrCode_5110 end===="); 1547 done(); 1548 } 1549 }); 1550 1551 /* 1552 * @tc.number : ActsAccountErrCode_5120 1553 * @tc.name : auth callback 1554 * @tc.desc : test the type of parameters does not match(authtype不匹配) 1555 */ 1556 it('ActsAccountErrCode_5120', 0, async function (done) { 1557 console.info("====>ActsAccountErrCode_5120 start===="); 1558 var appAccountManager = account.createAppAccountManager(); 1559 console.info("====>ActsAccountErrCode_5120 creat finish===="); 1560 try { 1561 appAccountManager.auth("test_name", "test_owner", 123456, { 1562 onResult: null, 1563 onRequestRedirected: null 1564 }) 1565 } catch(err) { 1566 console.info("====>ActsAccountErrCode_5120 auth catch err:" + JSON.stringify(err)); 1567 expect(err.code).assertEqual(401); 1568 console.info("====>ActsAccountErrCode_5120 end===="); 1569 done(); 1570 } 1571 }); 1572 1573 /* 1574 * @tc.number : ActsAccountErrCode_5130 1575 * @tc.name : auth callback 1576 * @tc.desc : test the type of parameters does not match(callback不匹配) 1577 */ 1578 it('ActsAccountErrCode_5130', 0, async function (done) { 1579 console.info("====>ActsAccountErrCode_5130 start===="); 1580 var appAccountManager = account.createAppAccountManager(); 1581 console.info("====>ActsAccountErrCode_5130 creat finish===="); 1582 try { 1583 appAccountManager.auth("test_name", "test_owner", 123456, "callback"); 1584 } catch(err) { 1585 console.info("====>ActsAccountErrCode_5130 auth catch err:" + JSON.stringify(err)); 1586 expect(err.code).assertEqual(401); 1587 console.info("====>ActsAccountErrCode_5130 end===="); 1588 done(); 1589 } 1590 }); 1591 1592 //getAuthToken 1593 /* 1594 * @tc.number : ActsAccountErrCode_5200 1595 * @tc.name : getAuthToken callback 1596 * @tc.desc : test the number of parameters does not match 1597 */ 1598 it('ActsAccountErrCode_5200', 0, async function (done) { 1599 console.info("====>ActsAccountErrCode_5200 start===="); 1600 var appAccountManager = account.createAppAccountManager(); 1601 console.info("====>ActsAccountErrCode_5200 creat finish===="); 1602 try { 1603 appAccountManager.getAuthToken((err, data)=>{ 1604 console.info("====>ActsAccountErrCode_5200 getAuthToken callback err:" + JSON.stringify(err)); 1605 expect().assertFail(); 1606 done(); 1607 }) 1608 } catch(err) { 1609 console.info("====>ActsAccountErrCode_5200 getAuthToken catch err:" + JSON.stringify(err)); 1610 expect(err.code).assertEqual(401); 1611 console.info("====>ActsAccountErrCode_5200 end===="); 1612 done(); 1613 } 1614 }); 1615 1616 /* 1617 * @tc.number : ActsAccountErrCode_5300 1618 * @tc.name : getAuthToken callback 1619 * @tc.desc : test the type of parameters does not match 1620 */ 1621 it('ActsAccountErrCode_5300', 0, async function (done) { 1622 console.info("====>ActsAccountErrCode_5300 start===="); 1623 var appAccountManager = account.createAppAccountManager(); 1624 console.info("====>ActsAccountErrCode_5300 creat finish===="); 1625 try { 1626 appAccountManager.getAuthToken("test_name", "test_owner", 12345, (err, data)=>{ 1627 console.info("====>ActsAccountErrCode_5300 getAuthToken callback err:" + JSON.stringify(err)); 1628 expect().assertFail(); 1629 done(); 1630 }) 1631 } catch(err) { 1632 console.info("====>ActsAccountErrCode_5300 getAuthToken catch err:" + JSON.stringify(err)); 1633 expect(err.code).assertEqual(401); 1634 console.info("====>ActsAccountErrCode_5300 end===="); 1635 done(); 1636 } 1637 }); 1638 1639 /* 1640 * @tc.number : ActsAccountErrCode_5310 1641 * @tc.name : getAuthToken callback 1642 * @tc.desc : test the type of parameters does not match(callback不匹配) 1643 */ 1644 it('ActsAccountErrCode_5310', 0, async function (done) { 1645 console.info("====>ActsAccountErrCode_5310 start===="); 1646 var appAccountManager = account.createAppAccountManager(); 1647 console.info("====>ActsAccountErrCode_5310 creat finish===="); 1648 try { 1649 appAccountManager.getAuthToken("test_name", "test_owner", "test_authType", 1234); 1650 } catch(err) { 1651 console.info("====>ActsAccountErrCode_5310 getAuthToken catch err:" + JSON.stringify(err)); 1652 expect(err.code).assertEqual(401); 1653 console.info("====>ActsAccountErrCode_5310 end===="); 1654 done(); 1655 } 1656 }); 1657 1658 /* 1659 * @tc.number : ActsAccountErrCode_5400 1660 * @tc.name : getAuthToken promise 1661 * @tc.desc : test the number of parameters does not match 1662 */ 1663 it('ActsAccountErrCode_5400', 0, async function (done) { 1664 console.info("====>ActsAccountErrCode_5400 start===="); 1665 var appAccountManager = account.createAppAccountManager(); 1666 console.info("====>ActsAccountErrCode_5400 creat finish===="); 1667 try { 1668 var authToken = appAccountManager.getAuthToken(); 1669 } catch(err) { 1670 console.info("====>ActsAccountErrCode_5400 getAuthToken catch err:" + JSON.stringify(err)); 1671 expect(err.code).assertEqual(401); 1672 console.info("====>ActsAccountErrCode_5400 end===="); 1673 done(); 1674 } 1675 }); 1676 1677 /* 1678 * @tc.number : ActsAccountErrCode_5500 1679 * @tc.name : getAuthToken promise 1680 * @tc.desc : test the type of parameters does not match(name不匹配) 1681 */ 1682 it('ActsAccountErrCode_5500', 0, async function (done) { 1683 console.info("====>ActsAccountErrCode_5500 start===="); 1684 var appAccountManager = account.createAppAccountManager(); 1685 console.info("====>ActsAccountErrCode_5500 creat finish===="); 1686 try { 1687 var authToken = appAccountManager.getAuthToken(12345, "test_owner", "test_authtype"); 1688 } catch(err) { 1689 console.info("====>ActsAccountErrCode_5500 getAuthToken catch err:" + JSON.stringify(err)); 1690 expect(err.code).assertEqual(401); 1691 console.info("====>ActsAccountErrCode_5500 end===="); 1692 done(); 1693 } 1694 }); 1695 1696 /* 1697 * @tc.number : ActsAccountErrCode_5510 1698 * @tc.name : getAuthToken promise 1699 * @tc.desc : test the type of parameters does not match(owner不匹配) 1700 */ 1701 it('ActsAccountErrCode_5510', 0, async function (done) { 1702 console.info("====>ActsAccountErrCode_5510 start===="); 1703 var appAccountManager = account.createAppAccountManager(); 1704 console.info("====>ActsAccountErrCode_5510 creat finish===="); 1705 try { 1706 var authToken = appAccountManager.getAuthToken("test_name", 12345, "test_authType"); 1707 } catch(err) { 1708 console.info("====>ActsAccountErrCode_5510 getAuthToken catch err:" + JSON.stringify(err)); 1709 expect(err.code).assertEqual(401); 1710 console.info("====>ActsAccountErrCode_5510 end===="); 1711 done(); 1712 } 1713 }); 1714 1715 /* 1716 * @tc.number : ActsAccountErrCode_5520 1717 * @tc.name : getAuthToken promise 1718 * @tc.desc : test the type of parameters does not match(owner不匹配) 1719 */ 1720 it('ActsAccountErrCode_5520', 0, async function (done) { 1721 console.info("====>ActsAccountErrCode_5520 start===="); 1722 var appAccountManager = account.createAppAccountManager(); 1723 console.info("====>ActsAccountErrCode_5520 creat finish===="); 1724 try { 1725 var authToken = appAccountManager.getAuthToken("test_name", "test_owner", 12345); 1726 } catch(err) { 1727 console.info("====>ActsAccountErrCode_5520 getAuthToken catch err:" + JSON.stringify(err)); 1728 expect(err.code).assertEqual(401); 1729 console.info("====>ActsAccountErrCode_5520 end===="); 1730 done(); 1731 } 1732 }); 1733 1734 //setAuthToken 1735 /* 1736 * @tc.number : ActsAccountErrCode_5600 1737 * @tc.name : setAuthToken callback 1738 * @tc.desc : test the number of parameters does not match 1739 */ 1740 it('ActsAccountErrCode_5600', 0, async function (done) { 1741 console.info("====>ActsAccountErrCode_5600 start===="); 1742 var appAccountManager = account.createAppAccountManager(); 1743 console.info("====>ActsAccountErrCode_5600 creat finish===="); 1744 try { 1745 appAccountManager.setAuthToken((err)=>{ 1746 console.info("====>ActsAccountErrCode_5600 setAuthToken callback err:" + JSON.stringify(err)); 1747 expect().assertFail(); 1748 done(); 1749 }) 1750 } catch(err) { 1751 console.info("====>ActsAccountErrCode_5600 setAuthToken catch err:" + JSON.stringify(err)); 1752 expect(err.code).assertEqual(401); 1753 console.info("====>ActsAccountErrCode_5600 end===="); 1754 done(); 1755 } 1756 }); 1757 1758 /* 1759 * @tc.number : ActsAccountErrCode_5700 1760 * @tc.name : setAuthToken callback 1761 * @tc.desc : test the type of parameters does not match 1762 */ 1763 it('ActsAccountErrCode_5700', 0, async function (done) { 1764 console.info("====>ActsAccountErrCode_5700 start===="); 1765 var appAccountManager = account.createAppAccountManager(); 1766 console.info("====>ActsAccountErrCode_5700 creat finish===="); 1767 try { 1768 appAccountManager.setAuthToken("test_name", 123456, "test_token", (err)=>{ 1769 console.info("====>ActsAccountErrCode_5700 setAuthToken callback err:" + JSON.stringify(err)); 1770 expect().assertFail(); 1771 done(); 1772 }) 1773 } catch(err) { 1774 console.info("====>ActsAccountErrCode_5700 setAuthToken catch err:" + JSON.stringify(err)); 1775 expect(err.code).assertEqual(401); 1776 console.info("====>ActsAccountErrCode_5700 end===="); 1777 done(); 1778 } 1779 }); 1780 1781 /* 1782 * @tc.number : ActsAccountErrCode_5710 1783 * @tc.name : setAuthToken callback 1784 * @tc.desc : test the type of parameters does not match(callback不匹配) 1785 */ 1786 it('ActsAccountErrCode_5710', 0, async function (done) { 1787 console.info("====>ActsAccountErrCode_5710 start===="); 1788 var appAccountManager = account.createAppAccountManager(); 1789 console.info("====>ActsAccountErrCode_5710 creat finish===="); 1790 try { 1791 appAccountManager.setAuthToken("test_name", "test_authType", "test_token", 1234); 1792 } catch(err) { 1793 console.info("====>ActsAccountErrCode_5710 setAuthToken catch err:" + JSON.stringify(err)); 1794 expect(err.code).assertEqual(401); 1795 console.info("====>ActsAccountErrCode_5710 end===="); 1796 done(); 1797 } 1798 }); 1799 1800 /* 1801 * @tc.number : ActsAccountErrCode_5400 1802 * @tc.name : setAuthToken promise 1803 * @tc.desc : test the number of parameters does not match 1804 */ 1805 it('ActsAccountErrCode_5800', 0, async function (done) { 1806 console.info("====>ActsAccountErrCode_5800 start===="); 1807 var appAccountManager = account.createAppAccountManager(); 1808 console.info("====>ActsAccountErrCode_5800 creat finish===="); 1809 try { 1810 appAccountManager.setAuthToken(); 1811 } catch(err) { 1812 console.info("====>ActsAccountErrCode_5800 setAuthToken catch err:" + JSON.stringify(err)); 1813 expect(err.code).assertEqual(401); 1814 console.info("====>ActsAccountErrCode_5800 end===="); 1815 done(); 1816 } 1817 }); 1818 1819 /* 1820 * @tc.number : ActsAccountErrCode_5900 1821 * @tc.name : setAuthToken promise 1822 * @tc.desc : test the type of parameters does not match(name不匹配) 1823 */ 1824 it('ActsAccountErrCode_5900', 0, async function (done) { 1825 console.info("====>ActsAccountErrCode_5900 start===="); 1826 var appAccountManager = account.createAppAccountManager(); 1827 console.info("====>ActsAccountErrCode_5900 creat finish===="); 1828 try { 1829 appAccountManager.setAuthToken(12345, "test_authType", "test_token"); 1830 } catch(err) { 1831 console.info("====>ActsAccountErrCode_5900 setAuthToken catch err:" + JSON.stringify(err)); 1832 expect(err.code).assertEqual(401); 1833 console.info("====>ActsAccountErrCode_5900 end===="); 1834 done(); 1835 } 1836 }); 1837 1838 /* 1839 * @tc.number : ActsAccountErrCode_5910 1840 * @tc.name : setAuthToken promise 1841 * @tc.desc : test the type of parameters does not match(authType不匹配) 1842 */ 1843 it('ActsAccountErrCode_5910', 0, async function (done) { 1844 console.info("====>ActsAccountErrCode_5910 start===="); 1845 var appAccountManager = account.createAppAccountManager(); 1846 console.info("====>ActsAccountErrCode_5910 creat finish===="); 1847 try { 1848 appAccountManager.setAuthToken("test_name", 123456, "test_token"); 1849 } catch(err) { 1850 console.info("====>ActsAccountErrCode_5910 setAuthToken catch err:" + JSON.stringify(err)); 1851 expect(err.code).assertEqual(401); 1852 console.info("====>ActsAccountErrCode_5910 end===="); 1853 done(); 1854 } 1855 }); 1856 1857 /* 1858 * @tc.number : ActsAccountErrCode_5920 1859 * @tc.name : setAuthToken promise 1860 * @tc.desc : test the type of parameters does not match(token不匹配) 1861 */ 1862 it('ActsAccountErrCode_5920', 0, async function (done) { 1863 console.info("====>ActsAccountErrCode_5920 start===="); 1864 var appAccountManager = account.createAppAccountManager(); 1865 console.info("====>ActsAccountErrCode_5920 creat finish===="); 1866 try { 1867 appAccountManager.setAuthToken("test_name", "test_authType", 1234); 1868 } catch(err) { 1869 console.info("====>ActsAccountErrCode_5920 setAuthToken catch err:" + JSON.stringify(err)); 1870 expect(err.code).assertEqual(401); 1871 console.info("====>ActsAccountErrCode_5920 end===="); 1872 done(); 1873 } 1874 }); 1875 1876 //deleteAuthToken 1877 /* 1878 * @tc.number : ActsAccountErrCode_6000 1879 * @tc.name : deleteAuthToken callback 1880 * @tc.desc : test the number of parameters does not match 1881 */ 1882 it('ActsAccountErrCode_6000', 0, async function (done) { 1883 console.info("====>ActsAccountErrCode_6000 start===="); 1884 var appAccountManager = account.createAppAccountManager(); 1885 console.info("====>ActsAccountErrCode_6000 creat finish===="); 1886 try { 1887 appAccountManager.deleteAuthToken((err)=>{ 1888 console.info("====>ActsAccountErrCode_6000 deleteAuthToken callback err:" + JSON.stringify(err)); 1889 expect().assertFail(); 1890 done(); 1891 }) 1892 } catch(err) { 1893 console.info("====>ActsAccountErrCode_6000 deleteAuthToken catch err:" + JSON.stringify(err)); 1894 expect(err.code).assertEqual(401); 1895 console.info("====>ActsAccountErrCode_6000 end===="); 1896 done(); 1897 } 1898 }); 1899 1900 /* 1901 * @tc.number : ActsAccountErrCode_6100 1902 * @tc.name : deleteAuthToken callback 1903 * @tc.desc : test the type of parameters does not match 1904 */ 1905 it('ActsAccountErrCode_6100', 0, async function (done) { 1906 console.info("====>ActsAccountErrCode_6100 start===="); 1907 var appAccountManager = account.createAppAccountManager(); 1908 console.info("====>ActsAccountErrCode_6100 creat finish===="); 1909 try { 1910 appAccountManager.deleteAuthToken("test_name", "test_owner", 123456, "test_token", (err)=>{ 1911 console.info("====>ActsAccountErrCode_6100 deleteAuthToken callback err:" + JSON.stringify(err)); 1912 expect().assertFail(); 1913 done(); 1914 }) 1915 } catch(err) { 1916 console.info("====>ActsAccountErrCode_6100 deleteAuthToken catch err:" + JSON.stringify(err)); 1917 expect(err.code).assertEqual(401); 1918 console.info("====>ActsAccountErrCode_6100 end===="); 1919 done(); 1920 } 1921 }); 1922 1923 /* 1924 * @tc.number : ActsAccountErrCode_6110 1925 * @tc.name : deleteAuthToken callback 1926 * @tc.desc : test the type of parameters does not match 1927 */ 1928 it('ActsAccountErrCode_6110', 0, async function (done) { 1929 console.info("====>ActsAccountErrCode_6110 start===="); 1930 var appAccountManager = account.createAppAccountManager(); 1931 console.info("====>ActsAccountErrCode_6110 creat finish===="); 1932 try { 1933 appAccountManager.deleteAuthToken("test_name", "test_owner", "test_authType", "test_token", 1234); 1934 } catch(err) { 1935 console.info("====>ActsAccountErrCode_6110 deleteAuthToken catch err:" + JSON.stringify(err)); 1936 expect(err.code).assertEqual(401); 1937 console.info("====>ActsAccountErrCode_6110 end===="); 1938 done(); 1939 } 1940 }); 1941 1942 /* 1943 * @tc.number : ActsAccountErrCode_6200 1944 * @tc.name : deleteAuthToken promise 1945 * @tc.desc : test the number of parameters does not match 1946 */ 1947 it('ActsAccountErrCode_6200', 0, async function (done) { 1948 console.info("====>ActsAccountErrCode_6200 start===="); 1949 var appAccountManager = account.createAppAccountManager(); 1950 console.info("====>ActsAccountErrCode_6200 creat finish===="); 1951 try { 1952 appAccountManager.deleteAuthToken(); 1953 } catch(err) { 1954 console.info("====>ActsAccountErrCode_6200 deleteAuthToken catch err:" + JSON.stringify(err)); 1955 expect(err.code).assertEqual(401); 1956 console.info("====>ActsAccountErrCode_6200 end===="); 1957 done(); 1958 } 1959 }); 1960 1961 /* 1962 * @tc.number : ActsAccountErrCode_6300 1963 * @tc.name : deleteAuthToken promise 1964 * @tc.desc : test the type of parameters does not match(name不匹配) 1965 */ 1966 it('ActsAccountErrCode_6300', 0, async function (done) { 1967 console.info("====>ActsAccountErrCode_6300 start===="); 1968 var appAccountManager = account.createAppAccountManager(); 1969 console.info("====>ActsAccountErrCode_6300 creat finish===="); 1970 try { 1971 appAccountManager.deleteAuthToken(1234, "test_owner", "test_authType", "test_token"); 1972 } catch(err) { 1973 console.info("====>ActsAccountErrCode_6300 deleteAuthToken catch err:" + JSON.stringify(err)); 1974 expect(err.code).assertEqual(401); 1975 console.info("====>ActsAccountErrCode_6300 end===="); 1976 done(); 1977 } 1978 }); 1979 1980 /* 1981 * @tc.number : ActsAccountErrCode_6310 1982 * @tc.name : deleteAuthToken promise 1983 * @tc.desc : test the type of parameters does not match(owner不匹配) 1984 */ 1985 it('ActsAccountErrCode_6310', 0, async function (done) { 1986 console.info("====>ActsAccountErrCode_6310 start===="); 1987 var appAccountManager = account.createAppAccountManager(); 1988 console.info("====>ActsAccountErrCode_6310 creat finish===="); 1989 try { 1990 appAccountManager.deleteAuthToken("test_name", 123456, "test_authType", "test_token"); 1991 } catch(err) { 1992 console.info("====>ActsAccountErrCode_6310 deleteAuthToken catch err:" + JSON.stringify(err)); 1993 expect(err.code).assertEqual(401); 1994 console.info("====>ActsAccountErrCode_6310 end===="); 1995 done(); 1996 } 1997 }); 1998 1999 /* 2000 * @tc.number : ActsAccountErrCode_6320 2001 * @tc.name : deleteAuthToken promise 2002 * @tc.desc : test the type of parameters does not match(authType不匹配) 2003 */ 2004 it('ActsAccountErrCode_6320', 0, async function (done) { 2005 console.info("====>ActsAccountErrCode_6320 start===="); 2006 var appAccountManager = account.createAppAccountManager(); 2007 console.info("====>ActsAccountErrCode_6320 creat finish===="); 2008 try { 2009 appAccountManager.deleteAuthToken("test_name", "test_owner", 1234, "test_token"); 2010 } catch(err) { 2011 console.info("====>ActsAccountErrCode_6320 deleteAuthToken catch err:" + JSON.stringify(err)); 2012 expect(err.code).assertEqual(401); 2013 console.info("====>ActsAccountErrCode_6320 end===="); 2014 done(); 2015 } 2016 }); 2017 2018 /* 2019 * @tc.number : ActsAccountErrCode_6330 2020 * @tc.name : deleteAuthToken promise 2021 * @tc.desc : test the type of parameters does not match(token不匹配) 2022 */ 2023 it('ActsAccountErrCode_6330', 0, async function (done) { 2024 console.info("====>ActsAccountErrCode_6330 start===="); 2025 var appAccountManager = account.createAppAccountManager(); 2026 console.info("====>ActsAccountErrCode_6330 creat finish===="); 2027 try { 2028 appAccountManager.deleteAuthToken("test_name", "test_owner", "test_authType", 1234); 2029 } catch(err) { 2030 console.info("====>ActsAccountErrCode_6330 deleteAuthToken catch err:" + JSON.stringify(err)); 2031 expect(err.code).assertEqual(401); 2032 console.info("====>ActsAccountErrCode_6330 end===="); 2033 done(); 2034 } 2035 }); 2036 2037 //setAuthTokenVisibility 2038 /* 2039 * @tc.number : ActsAccountErrCode_6000 2040 * @tc.name : setAuthTokenVisibility callback 2041 * @tc.desc : test the number of parameters does not match 2042 */ 2043 it('ActsAccountErrCode_6400', 0, async function (done) { 2044 console.info("====>ActsAccountErrCode_6400 start===="); 2045 var appAccountManager = account.createAppAccountManager(); 2046 console.info("====>ActsAccountErrCode_6400 creat finish===="); 2047 try { 2048 appAccountManager.setAuthTokenVisibility((err)=>{ 2049 console.info("====>ActsAccountErrCode_6400 setAuthTokenVisibility callback err:" + JSON.stringify(err)); 2050 expect().assertFail(); 2051 done(); 2052 }) 2053 } catch(err) { 2054 console.info("====>ActsAccountErrCode_6400 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2055 expect(err.code).assertEqual(401); 2056 console.info("====>ActsAccountErrCode_6400 end===="); 2057 done(); 2058 } 2059 }); 2060 2061 /* 2062 * @tc.number : ActsAccountErrCode_6500 2063 * @tc.name : setAuthTokenVisibility callback 2064 * @tc.desc : test the type of parameters does not match 2065 */ 2066 it('ActsAccountErrCode_6500', 0, async function (done) { 2067 console.info("====>ActsAccountErrCode_6500 start===="); 2068 var appAccountManager = account.createAppAccountManager(); 2069 console.info("====>ActsAccountErrCode_6500 creat finish===="); 2070 try { 2071 appAccountManager.setAuthTokenVisibility("test_name", "test_authType", 123456, true, (err)=>{ 2072 console.info("====>ActsAccountErrCode_6500 setAuthTokenVisibility callback err:" + JSON.stringify(err)); 2073 expect().assertFail(); 2074 done(); 2075 }) 2076 } catch(err) { 2077 console.info("====>ActsAccountErrCode_6500 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2078 expect(err.code).assertEqual(401); 2079 console.info("====>ActsAccountErrCode_6500 end===="); 2080 done(); 2081 } 2082 }); 2083 2084 /* 2085 * @tc.number : ActsAccountErrCode_6510 2086 * @tc.name : setAuthTokenVisibility callback 2087 * @tc.desc : test the type of parameters does not match 2088 */ 2089 it('ActsAccountErrCode_6510', 0, async function (done) { 2090 console.info("====>ActsAccountErrCode_6510 start===="); 2091 var appAccountManager = account.createAppAccountManager(); 2092 console.info("====>ActsAccountErrCode_6510 creat finish===="); 2093 try { 2094 appAccountManager.setAuthTokenVisibility("test_name", "test_authType", "test_bundleName", true, 1234); 2095 } catch(err) { 2096 console.info("====>ActsAccountErrCode_6510 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2097 expect(err.code).assertEqual(401); 2098 console.info("====>ActsAccountErrCode_6510 end===="); 2099 done(); 2100 } 2101 }); 2102 2103 /* 2104 * @tc.number : ActsAccountErrCode_6600 2105 * @tc.name : setAuthTokenVisibility promise 2106 * @tc.desc : test the number of parameters does not match 2107 */ 2108 it('ActsAccountErrCode_6600', 0, async function (done) { 2109 console.info("====>ActsAccountErrCode_6600 start===="); 2110 var appAccountManager = account.createAppAccountManager(); 2111 console.info("====>ActsAccountErrCode_6600 creat finish===="); 2112 try { 2113 appAccountManager.setAuthTokenVisibility(); 2114 } catch(err) { 2115 console.info("====>ActsAccountErrCode_6600 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2116 expect(err.code).assertEqual(401); 2117 console.info("====>ActsAccountErrCode_6600 end===="); 2118 done(); 2119 } 2120 }); 2121 2122 /* 2123 * @tc.number : ActsAccountErrCode_6700 2124 * @tc.name : setAuthTokenVisibility promise 2125 * @tc.desc : test the type of parameters does not match 2126 */ 2127 it('ActsAccountErrCode_6700', 0, async function (done) { 2128 console.info("====>ActsAccountErrCode_6700 start===="); 2129 var appAccountManager = account.createAppAccountManager(); 2130 console.info("====>ActsAccountErrCode_6700 creat finish===="); 2131 try { 2132 appAccountManager.setAuthTokenVisibility("test_name", "test_authType", 123456, true); 2133 } catch(err) { 2134 console.info("====>ActsAccountErrCode_6700 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2135 expect(err.code).assertEqual(401); 2136 console.info("====>ActsAccountErrCode_6700 end===="); 2137 done(); 2138 } 2139 }); 2140 2141 /* 2142 * @tc.number : ActsAccountErrCode_6710 2143 * @tc.name : setAuthTokenVisibility promise 2144 * @tc.desc : test the type of parameters does not match(name不匹配) 2145 */ 2146 it('ActsAccountErrCode_6710', 0, async function (done) { 2147 console.info("====>ActsAccountErrCode_6710 start===="); 2148 var appAccountManager = account.createAppAccountManager(); 2149 console.info("====>ActsAccountErrCode_6710 creat finish===="); 2150 try { 2151 appAccountManager.setAuthTokenVisibility(12345, "test_authType", "test_bundleName", true); 2152 } catch(err) { 2153 console.info("====>ActsAccountErrCode_6710 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2154 expect(err.code).assertEqual(401); 2155 console.info("====>ActsAccountErrCode_6710 end===="); 2156 done(); 2157 } 2158 }); 2159 2160 /* 2161 * @tc.number : ActsAccountErrCode_6710 2162 * @tc.name : setAuthTokenVisibility promise 2163 * @tc.desc : test the type of parameters does not match(authType不匹配) 2164 */ 2165 it('ActsAccountErrCode_6720', 0, async function (done) { 2166 console.info("====>ActsAccountErrCode_6720 start===="); 2167 var appAccountManager = account.createAppAccountManager(); 2168 console.info("====>ActsAccountErrCode_6720 creat finish===="); 2169 try { 2170 appAccountManager.setAuthTokenVisibility("test_name", 1234, "test_bundleName", true); 2171 } catch(err) { 2172 console.info("====>ActsAccountErrCode_6720 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2173 expect(err.code).assertEqual(401); 2174 console.info("====>ActsAccountErrCode_6720 end===="); 2175 done(); 2176 } 2177 }); 2178 2179 /* 2180 * @tc.number : ActsAccountErrCode_6720 2181 * @tc.name : setAuthTokenVisibility promise 2182 * @tc.desc : test the type of parameters does not match(bundleName不匹配) 2183 */ 2184 it('ActsAccountErrCode_6730', 0, async function (done) { 2185 console.info("====>ActsAccountErrCode_6730 start===="); 2186 var appAccountManager = account.createAppAccountManager(); 2187 console.info("====>ActsAccountErrCode_6730 creat finish===="); 2188 try { 2189 appAccountManager.setAuthTokenVisibility("test_name", "test_authType", 123456, true); 2190 } catch(err) { 2191 console.info("====>ActsAccountErrCode_6730 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2192 expect(err.code).assertEqual(401); 2193 console.info("====>ActsAccountErrCode_6730 end===="); 2194 done(); 2195 } 2196 }); 2197 2198 /* 2199 * @tc.number : ActsAccountErrCode_6730 2200 * @tc.name : setAuthTokenVisibility promise 2201 * @tc.desc : test the type of parameters does not match(isVisible不匹配) 2202 */ 2203 it('ActsAccountErrCode_6740', 0, async function (done) { 2204 console.info("====>ActsAccountErrCode_6740 start===="); 2205 var appAccountManager = account.createAppAccountManager(); 2206 console.info("====>ActsAccountErrCode_6740 creat finish===="); 2207 try { 2208 appAccountManager.setAuthTokenVisibility("test_name", "test_authType", "test_bundleName", "231"); 2209 } catch(err) { 2210 console.info("====>ActsAccountErrCode_6740 setAuthTokenVisibility catch err:" + JSON.stringify(err)); 2211 expect(err.code).assertEqual(401); 2212 console.info("====>ActsAccountErrCode_6740 end===="); 2213 done(); 2214 } 2215 }); 2216 2217 2218 2219 //getAllAuthTokens 2220 /* 2221 * @tc.number : ActsAccountErrCode_6800 2222 * @tc.name : getAllAuthTokens callback 2223 * @tc.desc : test the number of parameters does not match 2224 */ 2225 it('ActsAccountErrCode_6800', 0, async function (done) { 2226 console.info("====>ActsAccountErrCode_6800 start===="); 2227 var appAccountManager = account.createAppAccountManager(); 2228 console.info("====>ActsAccountErrCode_6800 creat finish===="); 2229 try { 2230 appAccountManager.getAllAuthTokens("test_name", (err, data)=>{ 2231 console.info("====>ActsAccountErrCode_6800 getAllAuthTokens callback err:" + JSON.stringify(err)); 2232 expect().assertFail(); 2233 done(); 2234 }) 2235 } catch(err) { 2236 console.info("====>ActsAccountErrCode_6800 getAllAuthTokens catch err:" + JSON.stringify(err)); 2237 expect(err.code).assertEqual(401); 2238 console.info("====>ActsAccountErrCode_6800 end===="); 2239 done(); 2240 } 2241 }); 2242 2243 /* 2244 * @tc.number : ActsAccountErrCode_6900 2245 * @tc.name : getAllAuthTokens callback 2246 * @tc.desc : test the type of parameters does not match 2247 */ 2248 it('ActsAccountErrCode_6900', 0, async function (done) { 2249 console.info("====>ActsAccountErrCode_6900 start===="); 2250 var appAccountManager = account.createAppAccountManager(); 2251 console.info("====>ActsAccountErrCode_6900 creat finish===="); 2252 try { 2253 appAccountManager.getAllAuthTokens("test_name", 123456, (err, data)=>{ 2254 console.info("====>ActsAccountErrCode_6900 getAllAuthTokens callback err:" + JSON.stringify(err)); 2255 expect().assertFail(); 2256 done(); 2257 }) 2258 } catch(err) { 2259 console.info("====>ActsAccountErrCode_6900 getAllAuthTokens catch err:" + JSON.stringify(err)); 2260 expect(err.code).assertEqual(401); 2261 console.info("====>ActsAccountErrCode_6900 end===="); 2262 done(); 2263 } 2264 }); 2265 2266 /* 2267 * @tc.number : ActsAccountErrCode_6910 2268 * @tc.name : getAllAuthTokens callback 2269 * @tc.desc : test the type of parameters does not match 2270 */ 2271 it('ActsAccountErrCode_6910', 0, async function (done) { 2272 console.info("====>ActsAccountErrCode_6910 start===="); 2273 var appAccountManager = account.createAppAccountManager(); 2274 console.info("====>ActsAccountErrCode_6910 creat finish===="); 2275 try { 2276 appAccountManager.getAllAuthTokens("test_name", "test_owner", 124); 2277 } catch(err) { 2278 console.info("====>ActsAccountErrCode_6910 getAllAuthTokens catch err:" + JSON.stringify(err)); 2279 expect(err.code).assertEqual(401); 2280 console.info("====>ActsAccountErrCode_6910 end===="); 2281 done(); 2282 } 2283 }); 2284 2285 /* 2286 * @tc.number : ActsAccountErrCode_7000 2287 * @tc.name : getAllAuthTokens promise 2288 * @tc.desc : test the number of parameters does not match 2289 */ 2290 it('ActsAccountErrCode_7000', 0, async function (done) { 2291 console.info("====>ActsAccountErrCode_7000 start===="); 2292 var appAccountManager = account.createAppAccountManager(); 2293 console.info("====>ActsAccountErrCode_7000 creat finish===="); 2294 try { 2295 var authTokenInfo = appAccountManager.getAllAuthTokens("test_name"); 2296 expect().assertFail(); 2297 done(); 2298 } catch(err) { 2299 console.info("====>ActsAccountErrCode_7000 getAllAuthTokens catch err:" + JSON.stringify(err)); 2300 expect(err.code).assertEqual(401); 2301 console.info("====>ActsAccountErrCode_7000 end===="); 2302 done(); 2303 } 2304 }); 2305 2306 /* 2307 * @tc.number : ActsAccountErrCode_7100 2308 * @tc.name : getAllAuthTokens promise 2309 * @tc.desc : test the type of parameters does not match(name不匹配) 2310 */ 2311 it('ActsAccountErrCode_7100', 0, async function (done) { 2312 console.info("====>ActsAccountErrCode_7100 start===="); 2313 var appAccountManager = account.createAppAccountManager(); 2314 console.info("====>ActsAccountErrCode_7100 creat finish===="); 2315 try { 2316 var authTokenInfo = appAccountManager.getAllAuthTokens(123456, "test_owner"); 2317 expect().assertFail(); 2318 done(); 2319 } catch(err) { 2320 console.info("====>ActsAccountErrCode_7100 getAllAuthTokens catch err:" + JSON.stringify(err)); 2321 expect(err.code).assertEqual(401); 2322 console.info("====>ActsAccountErrCode_7100 end===="); 2323 done(); 2324 } 2325 }); 2326 2327 /* 2328 * @tc.number : ActsAccountErrCode_7110 2329 * @tc.name : getAllAuthTokens promise 2330 * @tc.desc : test the type of parameters does not match(owner不匹配) 2331 */ 2332 it('ActsAccountErrCode_7110', 0, async function (done) { 2333 console.info("====>ActsAccountErrCode_7110 start===="); 2334 var appAccountManager = account.createAppAccountManager(); 2335 console.info("====>ActsAccountErrCode_7110 creat finish===="); 2336 try { 2337 var authTokenInfo = appAccountManager.getAllAuthTokens("test_name", 123456); 2338 expect().assertFail(); 2339 done(); 2340 } catch(err) { 2341 console.info("====>ActsAccountErrCode_7110 getAllAuthTokens catch err:" + JSON.stringify(err)); 2342 expect(err.code).assertEqual(401); 2343 console.info("====>ActsAccountErrCode_7110 end===="); 2344 done(); 2345 } 2346 }); 2347 2348 //getAuthList 2349 /* 2350 * @tc.number : ActsAccountErrCode_7200 2351 * @tc.name : getAuthList callback 2352 * @tc.desc : test the number of parameters does not match 2353 */ 2354 it('ActsAccountErrCode_7200', 0, async function (done) { 2355 console.info("====>ActsAccountErrCode_7200 start===="); 2356 var appAccountManager = account.createAppAccountManager(); 2357 console.info("====>ActsAccountErrCode_7200 creat finish===="); 2358 try { 2359 appAccountManager.getAuthList("test_name", (err, data)=>{ 2360 console.info("====>ActsAccountErrCode_7200 getAuthList callback err:" + JSON.stringify(err)); 2361 expect().assertFail(); 2362 done(); 2363 }) 2364 } catch(err) { 2365 console.info("====>ActsAccountErrCode_7200 getAuthList catch err:" + JSON.stringify(err)); 2366 expect(err.code).assertEqual(401); 2367 console.info("====>ActsAccountErrCode_7200 end===="); 2368 done(); 2369 } 2370 }); 2371 2372 /* 2373 * @tc.number : ActsAccountErrCode_7300 2374 * @tc.name : getAuthList callback 2375 * @tc.desc : test the type of parameters does not match 2376 */ 2377 it('ActsAccountErrCode_7300', 0, async function (done) { 2378 console.info("====>ActsAccountErrCode_7300 start===="); 2379 var appAccountManager = account.createAppAccountManager(); 2380 console.info("====>ActsAccountErrCode_7300 creat finish===="); 2381 try { 2382 appAccountManager.getAuthList("test_name", 123456, (err, data)=>{ 2383 console.info("====>ActsAccountErrCode_7300 getAuthList callback err:" + JSON.stringify(err)); 2384 expect().assertFail(); 2385 done(); 2386 }) 2387 } catch(err) { 2388 console.info("====>ActsAccountErrCode_7300 getAuthList catch err:" + JSON.stringify(err)); 2389 expect(err.code).assertEqual(401); 2390 console.info("====>ActsAccountErrCode_7300 end===="); 2391 done(); 2392 } 2393 }); 2394 2395 /* 2396 * @tc.number : ActsAccountErrCode_7310 2397 * @tc.name : getAuthList callback 2398 * @tc.desc : test the type of parameters does not match(callback不匹配) 2399 */ 2400 it('ActsAccountErrCode_7310', 0, async function (done) { 2401 console.info("====>ActsAccountErrCode_7310 start===="); 2402 var appAccountManager = account.createAppAccountManager(); 2403 console.info("====>ActsAccountErrCode_7310 creat finish===="); 2404 try { 2405 appAccountManager.getAuthList("test_name", "test_authType", 123456); 2406 } catch(err) { 2407 console.info("====>ActsAccountErrCode_7310 getAuthList catch err:" + JSON.stringify(err)); 2408 expect(err.code).assertEqual(401); 2409 console.info("====>ActsAccountErrCode_7310 end===="); 2410 done(); 2411 } 2412 }); 2413 2414 /* 2415 * @tc.number : ActsAccountErrCode_7400 2416 * @tc.name : getAuthList promise 2417 * @tc.desc : test the number of parameters does not match 2418 */ 2419 it('ActsAccountErrCode_7400', 0, async function (done) { 2420 console.info("====>ActsAccountErrCode_7400 start===="); 2421 var appAccountManager = account.createAppAccountManager(); 2422 console.info("====>ActsAccountErrCode_7400 creat finish===="); 2423 try { 2424 var authList = appAccountManager.getAuthList("test_name"); 2425 expect().assertFail(); 2426 done(); 2427 } catch(err) { 2428 console.info("====>ActsAccountErrCode_7400 getAuthList catch err:" + JSON.stringify(err)); 2429 expect(err.code).assertEqual(401); 2430 console.info("====>ActsAccountErrCode_7400 end===="); 2431 done(); 2432 } 2433 }); 2434 2435 /* 2436 * @tc.number : ActsAccountErrCode_7500 2437 * @tc.name : getAuthList promise 2438 * @tc.desc : test the type of parameters does not match(name不匹配) 2439 */ 2440 it('ActsAccountErrCode_7500', 0, async function (done) { 2441 console.info("====>ActsAccountErrCode_7500 start===="); 2442 var appAccountManager = account.createAppAccountManager(); 2443 console.info("====>ActsAccountErrCode_7500 creat finish===="); 2444 try { 2445 var authList = appAccountManager.getAuthList(123456, "test_authType"); 2446 expect().assertFail(); 2447 done(); 2448 } catch(err) { 2449 console.info("====>ActsAccountErrCode_7500 getAuthList catch err:" + JSON.stringify(err)); 2450 expect(err.code).assertEqual(401); 2451 console.info("====>ActsAccountErrCode_7500 end===="); 2452 done(); 2453 } 2454 }); 2455 2456 /* 2457 * @tc.number : ActsAccountErrCode_7510 2458 * @tc.name : getAuthList promise 2459 * @tc.desc : test the type of parameters does not match(authType不匹配) 2460 */ 2461 it('ActsAccountErrCode_7510', 0, async function (done) { 2462 console.info("====>ActsAccountErrCode_7510 start===="); 2463 var appAccountManager = account.createAppAccountManager(); 2464 console.info("====>ActsAccountErrCode_7510 creat finish===="); 2465 try { 2466 var authList = appAccountManager.getAuthList("test_name", 123456); 2467 expect().assertFail(); 2468 done(); 2469 } catch(err) { 2470 console.info("====>ActsAccountErrCode_7510 getAuthList catch err:" + JSON.stringify(err)); 2471 expect(err.code).assertEqual(401); 2472 console.info("====>ActsAccountErrCode_7510 end===="); 2473 done(); 2474 } 2475 }); 2476 2477 //getAuthCallback 2478 /* 2479 * @tc.number : ActsAccountErrCode_7600 2480 * @tc.name : getAuthCallback callback 2481 * @tc.desc : test the number of parameters does not match 2482 */ 2483 it('ActsAccountErrCode_7600', 0, async function (done) { 2484 console.info("====>ActsAccountErrCode_7600 start===="); 2485 var appAccountManager = account.createAppAccountManager(); 2486 console.info("====>ActsAccountErrCode_7600 creat finish===="); 2487 try { 2488 appAccountManager.getAuthCallback((err, databack)=>{ 2489 console.info("====>ActsAccountErrCode_7600 getAuthCallback callback err:" + JSON.stringify(err)); 2490 expect().assertFail(); 2491 done(); 2492 }) 2493 } catch(err) { 2494 console.info("====>ActsAccountErrCode_7600 getAuthCallback catch err:" + JSON.stringify(err)); 2495 expect(err.code).assertEqual(401); 2496 console.info("====>ActsAccountErrCode_7600 end===="); 2497 done(); 2498 } 2499 }); 2500 2501 /* 2502 * @tc.number : ActsAccountErrCode_7700 2503 * @tc.name : getAuthCallback callback 2504 * @tc.desc : test the type of parameters does not match 2505 */ 2506 it('ActsAccountErrCode_7700', 0, async function (done) { 2507 console.info("====>ActsAccountErrCode_7700 start===="); 2508 var appAccountManager = account.createAppAccountManager(); 2509 console.info("====>ActsAccountErrCode_7700 creat finish===="); 2510 try { 2511 appAccountManager.getAuthCallback(123456, (err, data)=>{ 2512 console.info("====>ActsAccountErrCode_7700 getAuthCallback callback err:" + JSON.stringify(err)); 2513 expect().assertFail(); 2514 done(); 2515 }) 2516 } catch(err) { 2517 console.info("====>ActsAccountErrCode_7700 getAuthCallback catch err:" + JSON.stringify(err)); 2518 expect(err.code).assertEqual(401); 2519 console.info("====>ActsAccountErrCode_7700 end===="); 2520 done(); 2521 } 2522 }); 2523 2524 /* 2525 * @tc.number : ActsAccountErrCode_7710 2526 * @tc.name : getAuthCallback callback 2527 * @tc.desc : test the type of parameters does not match(callback不匹配) 2528 */ 2529 it('ActsAccountErrCode_7710', 0, async function (done) { 2530 console.info("====>ActsAccountErrCode_7710 start===="); 2531 var appAccountManager = account.createAppAccountManager(); 2532 console.info("====>ActsAccountErrCode_7710 creat finish===="); 2533 try { 2534 appAccountManager.getAuthCallback("test_sessionId", 123456); 2535 } catch(err) { 2536 console.info("====>ActsAccountErrCode_7710 getAuthCallback catch err:" + JSON.stringify(err)); 2537 expect(err.code).assertEqual(401); 2538 console.info("====>ActsAccountErrCode_7710 end===="); 2539 done(); 2540 } 2541 }); 2542 2543 /* 2544 * @tc.number : ActsAccountErrCode_7800 2545 * @tc.name : getAuthCallback promise 2546 * @tc.desc : test the number of parameters does not match 2547 */ 2548 it('ActsAccountErrCode_7800', 0, async function (done) { 2549 console.info("====>ActsAccountErrCode_7800 start===="); 2550 var appAccountManager = account.createAppAccountManager(); 2551 console.info("====>ActsAccountErrCode_7800 creat finish===="); 2552 try { 2553 var authCallback = appAccountManager.getAuthCallback(); 2554 expect().assertFail(); 2555 done(); 2556 } catch(err) { 2557 console.info("====>ActsAccountErrCode_7800 getAuthCallback catch err:" + JSON.stringify(err)); 2558 expect(err.code).assertEqual(401); 2559 console.info("====>ActsAccountErrCode_7800 end===="); 2560 done(); 2561 } 2562 }); 2563 2564 /* 2565 * @tc.number : ActsAccountErrCode_7900 2566 * @tc.name : getAuthCallback promise 2567 * @tc.desc : test the type of parameters does not match 2568 */ 2569 it('ActsAccountErrCode_7900', 0, async function (done) { 2570 console.info("====>ActsAccountErrCode_7900 start===="); 2571 var appAccountManager = account.createAppAccountManager(); 2572 console.info("====>ActsAccountErrCode_7900 creat finish===="); 2573 try { 2574 var authCallback = appAccountManager.getAuthCallback(123456); 2575 expect().assertFail(); 2576 done(); 2577 } catch(err) { 2578 console.info("====>ActsAccountErrCode_7900 getAuthCallback catch err:" + JSON.stringify(err)); 2579 expect(err.code).assertEqual(401); 2580 console.info("====>ActsAccountErrCode_7900 end===="); 2581 done(); 2582 } 2583 }); 2584 2585 //queryAuthenticatorInfo 2586 /* 2587 * @tc.number : ActsAccountErrCode_8000 2588 * @tc.name : queryAuthenticatorInfo callback 2589 * @tc.desc : test the number of parameters does not match 2590 */ 2591 it('ActsAccountErrCode_8000', 0, async function (done) { 2592 console.info("====>ActsAccountErrCode_8000 start===="); 2593 var appAccountManager = account.createAppAccountManager(); 2594 console.info("====>ActsAccountErrCode_8000 creat finish===="); 2595 try { 2596 appAccountManager.queryAuthenticatorInfo((err, authenticatorInfo)=>{ 2597 console.info("====>ActsAccountErrCode_8000 queryAuthenticatorInfo callback err:" + JSON.stringify(err)); 2598 expect().assertFail(); 2599 done(); 2600 }) 2601 } catch(err) { 2602 console.info("====>ActsAccountErrCode_8000 queryAuthenticatorInfo catch err:" + JSON.stringify(err)); 2603 expect(err.code).assertEqual(401); 2604 console.info("====>ActsAccountErrCode_8000 end===="); 2605 done(); 2606 } 2607 }); 2608 2609 /* 2610 * @tc.number : ActsAccountErrCode_8100 2611 * @tc.name : queryAuthenticatorInfo callback 2612 * @tc.desc : test the type of parameters does not match 2613 */ 2614 it('ActsAccountErrCode_8100', 0, async function (done) { 2615 console.info("====>ActsAccountErrCode_8100 start===="); 2616 var appAccountManager = account.createAppAccountManager(); 2617 console.info("====>ActsAccountErrCode_8100 creat finish===="); 2618 try { 2619 appAccountManager.queryAuthenticatorInfo(123456, (err, authenticatorInfo)=>{ 2620 console.info("====>ActsAccountErrCode_8100 queryAuthenticatorInfo callback err:" + JSON.stringify(err)); 2621 expect().assertFail(); 2622 done(); 2623 }) 2624 } catch(err) { 2625 console.info("====>ActsAccountErrCode_8100 queryAuthenticatorInfo catch err:" + JSON.stringify(err)); 2626 expect(err.code).assertEqual(401); 2627 console.info("====>ActsAccountErrCode_8100 end===="); 2628 done(); 2629 } 2630 }); 2631 2632 /* 2633 * @tc.number : ActsAccountErrCode_8110 2634 * @tc.name : queryAuthenticatorInfo callback 2635 * @tc.desc : test the type of parameters does not match(callback不匹配) 2636 */ 2637 it('ActsAccountErrCode_8110', 0, async function (done) { 2638 console.info("====>ActsAccountErrCode_8110 start===="); 2639 var appAccountManager = account.createAppAccountManager(); 2640 console.info("====>ActsAccountErrCode_8110 creat finish===="); 2641 try { 2642 appAccountManager.queryAuthenticatorInfo("test_owner", 1234); 2643 } catch(err) { 2644 console.info("====>ActsAccountErrCode_8110 queryAuthenticatorInfo catch err:" + JSON.stringify(err)); 2645 expect(err.code).assertEqual(401); 2646 console.info("====>ActsAccountErrCode_8110 end===="); 2647 done(); 2648 } 2649 }); 2650 2651 /* 2652 * @tc.number : ActsAccountErrCode_8200 2653 * @tc.name : queryAuthenticatorInfo promise 2654 * @tc.desc : test the number of parameters does not match 2655 */ 2656 it('ActsAccountErrCode_8200', 0, async function (done) { 2657 console.info("====>ActsAccountErrCode_8200 start===="); 2658 var appAccountManager = account.createAppAccountManager(); 2659 console.info("====>ActsAccountErrCode_8200 creat finish===="); 2660 try { 2661 var authenticatorInfo = appAccountManager.queryAuthenticatorInfo(); 2662 expect().assertFail(); 2663 done(); 2664 } catch(err) { 2665 console.info("====>ActsAccountErrCode_8200 queryAuthenticatorInfo catch err:" + JSON.stringify(err)); 2666 expect(err.code).assertEqual(401); 2667 console.info("====>ActsAccountErrCode_8200 end===="); 2668 done(); 2669 } 2670 }); 2671 2672 /* 2673 * @tc.number : ActsAccountErrCode_8300 2674 * @tc.name : queryAuthenticatorInfo promise 2675 * @tc.desc : test the type of parameters does not match 2676 */ 2677 it('ActsAccountErrCode_8300', 0, async function (done) { 2678 console.info("====>ActsAccountErrCode_8300 start===="); 2679 var appAccountManager = account.createAppAccountManager(); 2680 console.info("====>ActsAccountErrCode_8300 creat finish===="); 2681 try { 2682 var authenticatorInfo = appAccountManager.queryAuthenticatorInfo(123456); 2683 expect().assertFail(); 2684 done(); 2685 } catch(err) { 2686 console.info("====>ActsAccountErrCode_8300 queryAuthenticatorInfo catch err:" + JSON.stringify(err)); 2687 expect(err.code).assertEqual(401); 2688 console.info("====>ActsAccountErrCode_8300 end===="); 2689 done(); 2690 } 2691 }); 2692 2693 2694 //deleteCredential 2695 /* 2696 * @tc.number : ActsAccountErrCode_8400 2697 * @tc.name : deleteCredential callback 2698 * @tc.desc : test the number of parameters does not match 2699 */ 2700 it('ActsAccountErrCode_8400', 0, async function (done) { 2701 console.info("====>ActsAccountErrCode_8400 start===="); 2702 var appAccountManager = account.createAppAccountManager(); 2703 console.info("====>ActsAccountErrCode_8400 creat finish===="); 2704 try { 2705 appAccountManager.deleteCredential("test_name", (err)=>{ 2706 console.info("====>ActsAccountErrCode_8400 deleteCredential callback err:" + JSON.stringify(err)); 2707 expect().assertFail(); 2708 done(); 2709 }) 2710 } catch(err) { 2711 console.info("====>ActsAccountErrCode_8400 deleteCredential catch err:" + JSON.stringify(err)); 2712 expect(err.code).assertEqual(401); 2713 console.info("====>ActsAccountErrCode_8400 end===="); 2714 done(); 2715 } 2716 }); 2717 2718 /* 2719 * @tc.number : ActsAccountErrCode_8500 2720 * @tc.name : deleteCredential callback 2721 * @tc.desc : test the type of parameters does not match 2722 */ 2723 it('ActsAccountErrCode_8500', 0, async function (done) { 2724 console.info("====>ActsAccountErrCode_8500 start===="); 2725 var appAccountManager = account.createAppAccountManager(); 2726 console.info("====>ActsAccountErrCode_8500 creat finish===="); 2727 try { 2728 appAccountManager.deleteCredential("test_name", 123456, (err)=>{ 2729 console.info("====>ActsAccountErrCode_8500 deleteCredential callback err:" + JSON.stringify(err)); 2730 expect().assertFail(); 2731 done(); 2732 }) 2733 } catch(err) { 2734 console.info("====>ActsAccountErrCode_8500 deleteCredential catch err:" + JSON.stringify(err)); 2735 expect(err.code).assertEqual(401); 2736 console.info("====>ActsAccountErrCode_8500 end===="); 2737 done(); 2738 } 2739 }); 2740 2741 /* 2742 * @tc.number : ActsAccountErrCode_8510 2743 * @tc.name : deleteCredential callback 2744 * @tc.desc : test the type of parameters does not match(callback不匹配) 2745 */ 2746 it('ActsAccountErrCode_8510', 0, async function (done) { 2747 console.info("====>ActsAccountErrCode_8510 start===="); 2748 var appAccountManager = account.createAppAccountManager(); 2749 console.info("====>ActsAccountErrCode_8510 creat finish===="); 2750 try { 2751 appAccountManager.deleteCredential("test_name", "test_credentialType", 122); 2752 } catch(err) { 2753 console.info("====>ActsAccountErrCode_8510 deleteCredential catch err:" + JSON.stringify(err)); 2754 expect(err.code).assertEqual(401); 2755 console.info("====>ActsAccountErrCode_8510 end===="); 2756 done(); 2757 } 2758 }); 2759 2760 /* 2761 * @tc.number : ActsAccountErrCode_8600 2762 * @tc.name : deleteCredential promise 2763 * @tc.desc : test the number of parameters does not match 2764 */ 2765 it('ActsAccountErrCode_8600', 0, async function (done) { 2766 console.info("====>ActsAccountErrCode_8600 start===="); 2767 var appAccountManager = account.createAppAccountManager(); 2768 console.info("====>ActsAccountErrCode_8600 creat finish===="); 2769 try { 2770 appAccountManager.deleteCredential(); 2771 expect().assertFail(); 2772 done(); 2773 } catch(err) { 2774 console.info("====>ActsAccountErrCode_8600 deleteCredential catch err:" + JSON.stringify(err)); 2775 expect(err.code).assertEqual(401); 2776 console.info("====>ActsAccountErrCode_8600 end===="); 2777 done(); 2778 } 2779 }); 2780 2781 /* 2782 * @tc.number : ActsAccountErrCode_8700 2783 * @tc.name : deleteCredential promise 2784 * @tc.desc : test the type of parameters does not match(credentialType不匹配) 2785 */ 2786 it('ActsAccountErrCode_8700', 0, async function (done) { 2787 console.info("====>ActsAccountErrCode_8700 start===="); 2788 var appAccountManager = account.createAppAccountManager(); 2789 console.info("====>ActsAccountErrCode_8700 creat finish===="); 2790 try { 2791 appAccountManager.deleteCredential("test_name", 123456); 2792 expect().assertFail(); 2793 done(); 2794 } catch(err) { 2795 console.info("====>ActsAccountErrCode_8700 deleteCredential catch err:" + JSON.stringify(err)); 2796 expect(err.code).assertEqual(401); 2797 console.info("====>ActsAccountErrCode_8700 end===="); 2798 done(); 2799 } 2800 }); 2801 2802 /* 2803 * @tc.number : ActsAccountErrCode_8710 2804 * @tc.name : deleteCredential promise 2805 * @tc.desc : test the type of parameters does not match(name不匹配) 2806 */ 2807 it('ActsAccountErrCode_8710', 0, async function (done) { 2808 console.info("====>ActsAccountErrCode_8710 start===="); 2809 var appAccountManager = account.createAppAccountManager(); 2810 console.info("====>ActsAccountErrCode_8710 creat finish===="); 2811 try { 2812 appAccountManager.deleteCredential(12345, "test_credentialType"); 2813 expect().assertFail(); 2814 done(); 2815 } catch(err) { 2816 console.info("====>ActsAccountErrCode_8710 deleteCredential catch err:" + JSON.stringify(err)); 2817 expect(err.code).assertEqual(401); 2818 console.info("====>ActsAccountErrCode_8710 end===="); 2819 done(); 2820 } 2821 }); 2822 2823 //verifyCredential 2824 /* 2825 * @tc.number : ActsAccountErrCode_8800 2826 * @tc.name : verifyCredential callback 2827 * @tc.desc : test the number of parameters does not match 2828 */ 2829 it('ActsAccountErrCode_8800', 0, async function (done) { 2830 console.info("====>ActsAccountErrCode_8800 start===="); 2831 var appAccountManager = account.createAppAccountManager(); 2832 console.info("====>ActsAccountErrCode_8800 creat finish===="); 2833 try { 2834 appAccountManager.verifyCredential("test_name", { 2835 onResult:null, 2836 onRequestRedirected:null, 2837 onRequestContinued: function(){ 2838 console.info("====>ActsAccountErrCode_8800 verifyCredential_onRequestContinued") 2839 } 2840 }) 2841 } catch(err) { 2842 console.info("====>ActsAccountErrCode_8800 verifyCredential catch err:" + JSON.stringify(err)); 2843 expect(err.code).assertEqual(401); 2844 console.info("====>ActsAccountErrCode_8800 end===="); 2845 done(); 2846 } 2847 }); 2848 2849 /* 2850 * @tc.number : ActsAccountErrCode_8900 2851 * @tc.name : verifyCredential callback 2852 * @tc.desc : test the type of parameters does not match(owner不匹配) 2853 */ 2854 it('ActsAccountErrCode_8900', 0, async function (done) { 2855 console.info("====>ActsAccountErrCode_8900 start===="); 2856 var appAccountManager = account.createAppAccountManager(); 2857 console.info("====>ActsAccountErrCode_8900 creat finish===="); 2858 try { 2859 appAccountManager.verifyCredential("test_name", 123456, { 2860 onResult:null, 2861 onRequestRedirected:null, 2862 onRequestContinued: function(){ 2863 console.info("====>ActsAccountErrCode_8900 verifyCredential_onRequestContinued") 2864 } 2865 }) 2866 } catch(err) { 2867 console.info("====>ActsAccountErrCode_8900 verifyCredential catch err:" + JSON.stringify(err)); 2868 expect(err.code).assertEqual(401); 2869 console.info("====>ActsAccountErrCode_8900 end===="); 2870 done(); 2871 } 2872 }); 2873 2874 /* 2875 * @tc.number : ActsAccountErrCode_8910 2876 * @tc.name : verifyCredential callback 2877 * @tc.desc : test the type of parameters does not match(name不匹配) 2878 */ 2879 it('ActsAccountErrCode_8910', 0, async function (done) { 2880 console.info("====>ActsAccountErrCode_8910 start===="); 2881 var appAccountManager = account.createAppAccountManager(); 2882 console.info("====>ActsAccountErrCode_8910 creat finish===="); 2883 try { 2884 appAccountManager.verifyCredential(12345, "test_owner", { 2885 onResult:null, 2886 onRequestRedirected:null, 2887 onRequestContinued: function(){ 2888 console.info("====>ActsAccountErrCode_8910 verifyCredential_onRequestContinued") 2889 } 2890 }) 2891 } catch(err) { 2892 console.info("====>ActsAccountErrCode_89100 verifyCredential catch err:" + JSON.stringify(err)); 2893 expect(err.code).assertEqual(401); 2894 console.info("====>ActsAccountErrCode_89100 end===="); 2895 done(); 2896 } 2897 }); 2898 2899 /* 2900 * @tc.number : ActsAccountErrCode_8920 2901 * @tc.name : verifyCredential callback 2902 * @tc.desc : test the type of parameters does not match(option不匹配) 2903 */ 2904 it('ActsAccountErrCode_8920', 0, async function (done) { 2905 console.info("====>ActsAccountErrCode_8920 start===="); 2906 var appAccountManager = account.createAppAccountManager(); 2907 console.info("====>ActsAccountErrCode_8920 creat finish===="); 2908 try { 2909 appAccountManager.verifyCredential("test_name", "test_owner", 1244, { 2910 onResult:null, 2911 onRequestRedirected:null, 2912 onRequestContinued: function(){ 2913 console.info("====>ActsAccountErrCode_8920 verifyCredential_onRequestContinued") 2914 } 2915 }) 2916 } catch(err) { 2917 console.info("====>ActsAccountErrCode_8920 verifyCredential catch err:" + JSON.stringify(err)); 2918 expect(err.code).assertEqual(401); 2919 console.info("====>ActsAccountErrCode_8920 end===="); 2920 done(); 2921 } 2922 }); 2923 2924 /* 2925 * @tc.number : ActsAccountErrCode_8930 2926 * @tc.name : verifyCredential callback 2927 * @tc.desc : test the type of parameters does not match(callback不匹配) 2928 */ 2929 it('ActsAccountErrCode_8930', 0, async function (done) { 2930 console.info("====>ActsAccountErrCode_8930 start===="); 2931 var appAccountManager = account.createAppAccountManager(); 2932 console.info("====>ActsAccountErrCode_8930 creat finish===="); 2933 var options = {credentialType: "PIN", credential: "123456"} 2934 try { 2935 appAccountManager.verifyCredential("test_name", "test_owner", options, 1234); 2936 } catch(err) { 2937 console.info("====>ActsAccountErrCode_8930 verifyCredential catch err:" + JSON.stringify(err)); 2938 expect(err.code).assertEqual(401); 2939 console.info("====>ActsAccountErrCode_8930 end===="); 2940 done(); 2941 } 2942 }); 2943 2944 2945 //setAuthenticatorProperties 2946 /* 2947 * @tc.number : ActsAccountErrCode_9000 2948 * @tc.name : setAuthenticatorProperties callback 2949 * @tc.desc : test the number of parameters does not match 2950 */ 2951 it('ActsAccountErrCode_9000', 0, async function (done) { 2952 console.info("====>ActsAccountErrCode_9000 start===="); 2953 var appAccountManager = account.createAppAccountManager(); 2954 console.info("====>ActsAccountErrCode_9000 creat finish===="); 2955 try { 2956 appAccountManager.setAuthenticatorProperties({ 2957 onResult:null, 2958 onRequestRedirected:null, 2959 onRequestContinued: function(){ 2960 console.info("====>ActsAccountErrCode_9000 setAuthenticatorProperties") 2961 } 2962 }) 2963 } catch(err) { 2964 console.info("====>ActsAccountErrCode_9000 setAuthenticatorProperties catch err:" + JSON.stringify(err)); 2965 expect(err.code).assertEqual(401); 2966 console.info("====>ActsAccountErrCode_9000 end===="); 2967 done(); 2968 } 2969 }); 2970 2971 /* 2972 * @tc.number : ActsAccountErrCode_9100 2973 * @tc.name : setAuthenticatorProperties callback 2974 * @tc.desc : test the type of parameters does not match(owner不匹配) 2975 */ 2976 it('ActsAccountErrCode_9100', 0, async function (done) { 2977 console.info("====>ActsAccountErrCode_9100 start===="); 2978 var appAccountManager = account.createAppAccountManager(); 2979 console.info("====>ActsAccountErrCode_9100 creat finish===="); 2980 try { 2981 appAccountManager.setAuthenticatorProperties(123456, { 2982 onResult:null, 2983 onRequestRedirected:null, 2984 onRequestContinued: function(){ 2985 console.info("====>ActsAccountErrCode_9100 setAuthenticatorProperties") 2986 } 2987 }) 2988 } catch(err) { 2989 console.info("====>ActsAccountErrCode_9100 setAuthenticatorProperties catch err:" + JSON.stringify(err)); 2990 expect(err.code).assertEqual(401); 2991 console.info("====>ActsAccountErrCode_9100 end===="); 2992 done(); 2993 } 2994 }); 2995 2996 /* 2997 * @tc.number : ActsAccountErrCode_9110 2998 * @tc.name : setAuthenticatorProperties callback 2999 * @tc.desc : test the type of parameters does not match(option不匹配) 3000 */ 3001 it('ActsAccountErrCode_9110', 0, async function (done) { 3002 console.info("====>ActsAccountErrCode_9110 start===="); 3003 var appAccountManager = account.createAppAccountManager(); 3004 console.info("====>ActsAccountErrCode_9110 creat finish===="); 3005 try { 3006 appAccountManager.setAuthenticatorProperties("test_owner", 12345, { 3007 onResult:null, 3008 onRequestRedirected:null, 3009 onRequestContinued: function(){ 3010 console.info("====>ActsAccountErrCode_9110 setAuthenticatorProperties") 3011 } 3012 }) 3013 } catch(err) { 3014 console.info("====>ActsAccountErrCode_9110 setAuthenticatorProperties catch err:" + JSON.stringify(err)); 3015 expect(err.code).assertEqual(401); 3016 console.info("====>ActsAccountErrCode_9110 end===="); 3017 done(); 3018 } 3019 }); 3020 3021 /* 3022 * @tc.number : ActsAccountErrCode_9120 3023 * @tc.name : setAuthenticatorProperties callback 3024 * @tc.desc : test the type of parameters does not match(callback不匹配) 3025 */ 3026 it('ActsAccountErrCode_9120', 0, async function (done) { 3027 console.info("====>ActsAccountErrCode_9120 start===="); 3028 var appAccountManager = account.createAppAccountManager(); 3029 console.info("====>ActsAccountErrCode_9120 creat finish===="); 3030 var options = {credentialType: "PIN", credential: "123456"} 3031 try { 3032 appAccountManager.setAuthenticatorProperties("test_owner", options, 124); 3033 } catch(err) { 3034 console.info("====>ActsAccountErrCode_9120 setAuthenticatorProperties catch err:" + JSON.stringify(err)); 3035 expect(err.code).assertEqual(401); 3036 console.info("====>ActsAccountErrCode_9120 end===="); 3037 done(); 3038 } 3039 }); 3040 3041 //on 3042 /* 3043 * @tc.number : ActsAccountErrCode_9200 3044 * @tc.name : on callback 3045 * @tc.desc : test the number of parameters does not match 3046 */ 3047 it('ActsAccountErrCode_9200', 0, async function (done) { 3048 console.info("====>ActsAccountErrCode_9200 start===="); 3049 var appAccountManager = account.createAppAccountManager(); 3050 console.info("====>ActsAccountErrCode_9200 creat finish===="); 3051 try { 3052 appAccountManager.on('accountChange', function(data){ 3053 console.info("====>ActsAccountErrCode_9200 on catch err:" + JSON.stringify(data)); 3054 }); 3055 } catch(err) { 3056 console.info("====>ActsAccountErrCode_9200 on catch err:" + JSON.stringify(err)); 3057 expect(err.code).assertEqual(401); 3058 console.info("====>ActsAccountErrCode_9200 end===="); 3059 done(); 3060 } 3061 }); 3062 3063 /* 3064 * @tc.number : ActsAccountErrCode_9300 3065 * @tc.name : on callback 3066 * @tc.desc : test the type of parameters does not match(Array<owner>不匹配) 3067 */ 3068 it('ActsAccountErrCode_9300', 0, async function (done) { 3069 console.info("====>ActsAccountErrCode_9300 start===="); 3070 var appAccountManager = account.createAppAccountManager(); 3071 console.info("====>ActsAccountErrCode_9300 creat finish===="); 3072 try { 3073 appAccountManager.on('accountChange', 12356, function(data){ 3074 console.info("====>ActsAccountErrCode_9300 on catch err:" + JSON.stringify(data)); 3075 }) 3076 } catch(err) { 3077 console.info("====>ActsAccountErrCode_9300 on catch err:" + JSON.stringify(err)); 3078 expect(err.code).assertEqual(401); 3079 console.info("====>ActsAccountErrCode_9300 end===="); 3080 done(); 3081 } 3082 }); 3083 3084 /* 3085 * @tc.number : ActsAccountErrCode_9400 3086 * @tc.name : on callback 3087 * @tc.desc : test the type of parameters does not match(accountChange不匹配) 3088 */ 3089 it('ActsAccountErrCode_9400', 0, async function (done) { 3090 console.info("====>ActsAccountErrCode_9400 start===="); 3091 var appAccountManager = account.createAppAccountManager(); 3092 console.info("====>ActsAccountErrCode_9400 creat finish===="); 3093 try { 3094 appAccountManager.on(12345, ["test_owner"], function(data){ 3095 console.info("====>ActsAccountErrCode_9400 on catch err:" + JSON.stringify(data)); 3096 }) 3097 } catch(err) { 3098 console.info("====>ActsAccountErrCode_9400 on catch err:" + JSON.stringify(err)); 3099 expect(err.code).assertEqual(401); 3100 console.info("====>ActsAccountErrCode_9400 end===="); 3101 done(); 3102 } 3103 }); 3104 3105 //off 3106 /* 3107 * @tc.number : ActsAccountErrCode_9500 3108 * @tc.name : off callback 3109 * @tc.desc : test the number of parameters does not match 3110 */ 3111 it('ActsAccountErrCode_9500', 0, async function (done) { 3112 console.info("====>ActsAccountErrCode_9500 start===="); 3113 var appAccountManager = account.createAppAccountManager(); 3114 console.info("====>ActsAccountErrCode_9500 creat finish===="); 3115 try { 3116 appAccountManager.off(); 3117 } catch(err) { 3118 console.info("====>ActsAccountErrCode_9500 off catch err:" + JSON.stringify(err)); 3119 expect(err.code).assertEqual(401); 3120 console.info("====>ActsAccountErrCode_9500 end===="); 3121 done(); 3122 } 3123 }); 3124 3125 /* 3126 * @tc.number : ActsAccountErrCode_9600 3127 * @tc.name : off callback 3128 * @tc.desc : test the type of parameters does not match 3129 */ 3130 it('ActsAccountErrCode_9600', 0, async function (done) { 3131 console.info("====>ActsAccountErrCode_9600 start===="); 3132 var appAccountManager = account.createAppAccountManager(); 3133 console.info("====>ActsAccountErrCode_9600 creat finish===="); 3134 try { 3135 appAccountManager.off(123456); 3136 } catch(err) { 3137 console.info("====>ActsAccountErrCode_9600 off catch err:" + JSON.stringify(err)); 3138 expect(err.code).assertEqual(401); 3139 console.info("====>ActsAccountErrCode_9600 end===="); 3140 done(); 3141 } 3142 }); 3143 3144 //checkAuthTokenVisibility 3145 /* 3146 * @tc.number : ActsAccountErrCode_6000 3147 * @tc.name : checkAuthTokenVisibility callback 3148 * @tc.desc : test the number of parameters does not match 3149 */ 3150 it('ActsAccountErrCode_9700', 0, async function (done) { 3151 console.info("====>ActsAccountErrCode_9700 start===="); 3152 var appAccountManager = account.createAppAccountManager(); 3153 console.info("====>ActsAccountErrCode_9700 creat finish===="); 3154 try { 3155 appAccountManager.checkAuthTokenVisibility((err)=>{ 3156 console.info("====>ActsAccountErrCode_9700 checkAuthTokenVisibility callback err:" + JSON.stringify(err)); 3157 expect().assertFail(); 3158 done(); 3159 }) 3160 } catch(err) { 3161 console.info("====>ActsAccountErrCode_9700 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3162 expect(err.code).assertEqual(401); 3163 console.info("====>ActsAccountErrCode_9700 end===="); 3164 done(); 3165 } 3166 }); 3167 3168 /* 3169 * @tc.number : ActsAccountErrCode_9800 3170 * @tc.name : checkAuthTokenVisibility callback 3171 * @tc.desc : test the type of parameters does not match 3172 */ 3173 it('ActsAccountErrCode_9800', 0, async function (done) { 3174 console.info("====>ActsAccountErrCode_9800 start===="); 3175 var appAccountManager = account.createAppAccountManager(); 3176 console.info("====>ActsAccountErrCode_9800 creat finish===="); 3177 try { 3178 appAccountManager.checkAuthTokenVisibility("test_name", "test_authType", 123456, (err)=>{ 3179 console.info("====>ActsAccountErrCode_9800 checkAuthTokenVisibility callback err:" + JSON.stringify(err)); 3180 expect().assertFail(); 3181 done(); 3182 }) 3183 } catch(err) { 3184 console.info("====>ActsAccountErrCode_9800 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3185 expect(err.code).assertEqual(401); 3186 console.info("====>ActsAccountErrCode_9800 end===="); 3187 done(); 3188 } 3189 }); 3190 3191 /* 3192 * @tc.number : ActsAccountErrCode_9810 3193 * @tc.name : checkAuthTokenVisibility callback 3194 * @tc.desc : test the type of parameters does not match(callback不匹配) 3195 */ 3196 it('ActsAccountErrCode_9810', 0, async function (done) { 3197 console.info("====>ActsAccountErrCode_9810 start===="); 3198 var appAccountManager = account.createAppAccountManager(); 3199 console.info("====>ActsAccountErrCode_9810 creat finish===="); 3200 try { 3201 appAccountManager.checkAuthTokenVisibility("test_name", "test_authType", "test_bundleName", 12234); 3202 } catch(err) { 3203 console.info("====>ActsAccountErrCode_9810 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3204 expect(err.code).assertEqual(401); 3205 console.info("====>ActsAccountErrCode_9810 end===="); 3206 done(); 3207 } 3208 }); 3209 3210 /* 3211 * @tc.number : ActsAccountErrCode_6600 3212 * @tc.name : checkAuthTokenVisibility promise 3213 * @tc.desc : test the number of parameters does not match 3214 */ 3215 it('ActsAccountErrCode_9900', 0, async function (done) { 3216 console.info("====>ActsAccountErrCode_9900 start===="); 3217 var appAccountManager = account.createAppAccountManager(); 3218 console.info("====>ActsAccountErrCode_9900 creat finish===="); 3219 try { 3220 var visibility = appAccountManager.checkAuthTokenVisibility("test_name"); 3221 } catch(err) { 3222 console.info("====>ActsAccountErrCode_9900 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3223 expect(err.code).assertEqual(401); 3224 console.info("====>ActsAccountErrCode_9900 end===="); 3225 done(); 3226 } 3227 }); 3228 3229 /* 3230 * @tc.number : ActsAccountErrCode_10000 3231 * @tc.name : checkAuthTokenVisibility promise 3232 * @tc.desc : test the type of parameters does not match(name不匹配) 3233 */ 3234 it('ActsAccountErrCode_10000', 0, async function (done) { 3235 console.info("====>ActsAccountErrCode_6700 start===="); 3236 var appAccountManager = account.createAppAccountManager(); 3237 console.info("====>ActsAccountErrCode_10000 creat finish===="); 3238 try { 3239 var visibility = appAccountManager.checkAuthTokenVisibility(12345, "test_authType", "test_bundleName"); 3240 } catch(err) { 3241 console.info("====>ActsAccountErrCode_10000 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3242 expect(err.code).assertEqual(401); 3243 console.info("====>ActsAccountErrCode_10000 end===="); 3244 done(); 3245 } 3246 }); 3247 3248 /* 3249 * @tc.number : ActsAccountErrCode_6710 3250 * @tc.name : checkAuthTokenVisibility promise 3251 * @tc.desc : test the type of parameters does not match(authType不匹配) 3252 */ 3253 it('ActsAccountErrCode_10010', 0, async function (done) { 3254 console.info("====>ActsAccountErrCode_10010 start===="); 3255 var appAccountManager = account.createAppAccountManager(); 3256 console.info("====>ActsAccountErrCode_10010 creat finish===="); 3257 try { 3258 var visibility = appAccountManager.checkAuthTokenVisibility("test_name", 1234, "test_bundleName"); 3259 } catch(err) { 3260 console.info("====>ActsAccountErrCode_10010 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3261 expect(err.code).assertEqual(401); 3262 console.info("====>ActsAccountErrCode_10010 end===="); 3263 done(); 3264 } 3265 }); 3266 3267 /* 3268 * @tc.number : ActsAccountErrCode_6720 3269 * @tc.name : checkAuthTokenVisibility promise 3270 * @tc.desc : test the type of parameters does not match(authType不匹配) 3271 */ 3272 it('ActsAccountErrCode_10020', 0, async function (done) { 3273 console.info("====>ActsAccountErrCode_10020 start===="); 3274 var appAccountManager = account.createAppAccountManager(); 3275 console.info("====>ActsAccountErrCode_10020 creat finish===="); 3276 try { 3277 var visibility = appAccountManager.checkAuthTokenVisibility("test_name", "test_authType", 12345); 3278 } catch(err) { 3279 console.info("====>ActsAccountErrCode_10020 checkAuthTokenVisibility catch err:" + JSON.stringify(err)); 3280 expect(err.code).assertEqual(401); 3281 console.info("====>ActsAccountErrCode_10020 end===="); 3282 done(); 3283 } 3284 }); 3285 3286 }) 3287}