提交 de982937 编写于 作者: J jiyong

jiyong@huawei.com

Signed-off-by: Njiyong <jiyong@huawei.com>
上级 e5151a98
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import systemTime from '@ohos.systemTime' import systemTime from '@ohos.systemTime'
describe('TimeTest', function() { describe('TimeTest', function(){
console.log('start################################start'); console.log('start################################start');
/** /**
* @tc.number SUB_systemTime_setTime_JS_API_0100 * @tc.number SUB_systemTime_setTime_JS_API_0100
* @tc.name Test systemTime.setTime * @tc.name Test systemTime.setTime
...@@ -103,18 +104,19 @@ describe('TimeTest', function() { ...@@ -103,18 +104,19 @@ describe('TimeTest', function() {
console.log('SUB_systemTime_setTime_JS_API_0400 end'); console.log('SUB_systemTime_setTime_JS_API_0400 end');
done() done()
}) })
/** /**
* @tc.number SUB_systemTime_setData_JS_API_0100 * @tc.number SUB_systemTime_setDate_JS_API_0100
* @tc.name Test systemTime.setData Invalid value * @tc.name Test systemTime.setDate Invalid value
* @tc.desc Test systemTime_setData API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setData_test1', 0, async function (done) { it('systemTime_setDate_test1', 0, async function (done) {
console.log("SUB_systemTime_setTime_JS_API_0100 start"); console.log("SUB_systemTime_setDate_JS_API_0100 start");
var data = new Data("October 13, 2020 11:13:00"); var data = new Date("October 13, 2020 11:13:00");
systemTime.setData(-1).then(data => { systemTime.setDate(-1).then(data => {
console.log("setTime ===data " + data); console.log("setTime ===data " + data);
done(); done();
}).catch(error => { }).catch(error => {
...@@ -122,17 +124,18 @@ describe('TimeTest', function() { ...@@ -122,17 +124,18 @@ describe('TimeTest', function() {
done(); done();
}); });
}); });
/** /**
* @tc.number SUB_systemTime_setData_JS_API_0200 * @tc.number SUB_systemTime_setDate_JS_API_0200
* @tc.name Test systemTime.setData Invalid value * @tc.name Test systemTime.setDate Invalid value
* @tc.desc Test systemTime_setData API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setData_test2', 0, async function (done) { it('systemTime_setDate_test2', 0, async function (done) {
console.log("SUB_systemTime_setTime_JS_API_0200 start"); console.log("SUB_systemTime_setDate_JS_API_0200 start");
systemTime.setData(0).then(data => { systemTime.setDate(0).then(data => {
console.log("setTime ===data " + data); console.log("setTime ===data " + data);
done(); done();
}).catch(error => { }).catch(error => {
...@@ -140,18 +143,19 @@ describe('TimeTest', function() { ...@@ -140,18 +143,19 @@ describe('TimeTest', function() {
done(); done();
}); });
}); });
/** /**
* @tc.number SUB_systemTime_setData_JS_API_0300 * @tc.number SUB_systemTime_setDate_JS_API_0300
* @tc.name Test systemTime.setData Invalid value * @tc.name Test systemTime.setDate Invalid value
* @tc.desc Test systemTime_setData API functionality. * @tc.desc Test systemTime_setDate API functionality.
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('systemTime_setData_test3', 0, async function (done) { it('systemTime_setDate_test3', 0, async function (done) {
console.log("SUB_systemTime_setTime_JS_API_0200 start"); console.log("SUB_systemTime_setDate_JS_API_0300 start");
var data = new Data("October 13, 2020 11:13:00"); var data = new Date("October 13, 2020 11:13:00");
systemTime.setData(data, (error, data) => { systemTime.setDate(data, (error, data) => {
if(error){ if(error){
console.log("setTime ===error " + error); console.log("setTime ===error " + error);
done(); done();
...@@ -161,6 +165,7 @@ describe('TimeTest', function() { ...@@ -161,6 +165,7 @@ describe('TimeTest', function() {
} }
}); });
}); });
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_0100 * @tc.number SUB_systemTime_setTimezone_JS_API_0100
* @tc.name Test systemTime.setTimezone Invalid value * @tc.name Test systemTime.setTimezone Invalid value
...@@ -179,6 +184,7 @@ describe('TimeTest', function() { ...@@ -179,6 +184,7 @@ describe('TimeTest', function() {
done(); done();
}); });
}); });
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_0200 * @tc.number SUB_systemTime_setTimezone_JS_API_0200
* @tc.name Test systemTime.setTimezone Invalid value * @tc.name Test systemTime.setTimezone Invalid value
...@@ -197,6 +203,7 @@ describe('TimeTest', function() { ...@@ -197,6 +203,7 @@ describe('TimeTest', function() {
done(); done();
}); });
}); });
/** /**
* @tc.number SUB_systemTime_setTimezone_JS_API_0300 * @tc.number SUB_systemTime_setTimezone_JS_API_0300
* @tc.name Test systemTime.setTimezone Invalid value * @tc.name Test systemTime.setTimezone Invalid value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册