提交 7894efaa 编写于 作者: J jianghuanhuan

telephony-接口用例补充

Signed-off-by: Njianghuanhuan <jianghuanhuan@huawei.com>
上级 d7635faf
......@@ -158,6 +158,21 @@ export default function dataJsunit() {
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
/**
* @tc.number Telephony_Data_DefaultCellularDataSimId_DATA_GET_SimId
* @tc.name Enum DataConnectState
* @tc.desc Enum value test
*/
it("Telephony_Data_DefaultCellularDataSimId_DATA_GET_SimId", 0, async function (done) {
let caseName = 'Telephony_Data_DefaultCellularDataSimId_DATA_GET_SimId';
console.log(`==========> ${caseName} Test start ==========>`);
console.log("Result: "+ data.getDefaultCellularDataSimId());
expect(true).assertTrue();
console.log(`==========> ${caseName} Test end ==========>`);
done();
});
});
}
......
......@@ -14,6 +14,7 @@
*/
import { describe, expect, it } from '@ohos/hypium';
import sms from '@ohos.telephony.sms';
import radio from '@ohos.telephony.radio';
export default function smsUiJsunit() {
describe('smsUiJsunit', function () {
......@@ -120,5 +121,51 @@ export default function smsUiJsunit() {
expect(sms.ShortMessageClass.FORWARD_MESSAGE == 4).assertTrue();
done();
});
/**
* @tc.number Telephony_Sms_getDefaultSmsSimId_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sms_getDefaultSmsSimId_CallBack_0100', 0, async function (done) {
sms.getDefaultSmsSimId((err, data) => {
if(err){
console.info("Telephony_Sms_getDefaultSmsSimId_CallBack_0100 err = " + JSON.stringify(data));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sms_getDefaultSmsSimId_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
return;
}
console.log(`Telephony_Sms_getDefaultSmsSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
});
});
/**
* @tc.number Telephony_Sms_getDefaultSmsSimId_Promise_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sms_getDefaultSmsSimId_Promise_0100', 0, async function (done) {
let promise = sms.getDefaultSmsSimId();
promise.then(data => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch(err => {
console.info("Telephony_Sms_getDefaultSmsSimId_Promise_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sms_getDefaultSmsSimId_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
});
});
})
}
......@@ -14,6 +14,7 @@
*/
import sim from '@ohos.telephony.sim';
import radio from '@ohos.telephony.radio';
import * as env from './lib/Const';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
export default function SimManagerTest() {
......@@ -496,5 +497,144 @@ describe('SimManagerTest', function () {
done();
});
});
/**
* @tc.number Telephony_Sim_getSimAccountInfo_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sim_getSimAccountInfo_CallBack_0100', 0, async function (done) {
sim.getSimAccountInfo(0, (err, data) => {
if(err){
console.info("Telephony_Sim_getSimAccountInfo_CallBack_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getSimAccountInfo_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
return;
}
console.log(`Telephony_Sim_getSimAccountInfo_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
});
});
/**
* @tc.number Telephony_Sim_getSimAccountInfo_Promise_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sim_getSimAccountInfo_Promise_0100', 0, async function (done) {
let promise = sim.getSimAccountInfo(0);
promise.then(data => {
console.info("Telephony_Sim_getSimAccountInfo_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch(err => {
console.info("Telephony_Sim_getSimAccountInfo_Promise_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getSimAccountInfo_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
});
});
/**
* @tc.number Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100', 0, async function (done) {
sim.getActiveSimAccountInfoList((err, data) => {
if(err){
console.info("Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
return;
}
console.log(`Telephony_Sim_getActiveSimAccountInfoList_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
});
});
/**
* @tc.number Telephony_Sim_getActiveSimAccountInfoList_Promise_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sim_getActiveSimAccountInfoList_Promise_0100', 0, async function (done) {
let promise = sim.getActiveSimAccountInfoList();
promise.then(data => {
console.info("Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch(err => {
console.info("Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getActiveSimAccountInfoList_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
});
});
/**
* @tc.number Telephony_Sim_getDefaultVoiceSimId_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sim_getDefaultVoiceSimId_CallBack_0100', 0, async function (done) {
sim.getDefaultVoiceSimId((err, data) => {
if(err){
console.info("Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
return;
}
console.log(`Telephony_Sim_getDefaultVoiceSimId_CallBack_0100 callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
expect(true).assertTrue();
done();
});
});
/**
* @tc.number Telephony_Sim_getDefaultVoiceSimId_Promise_0100
* @tc.name Test getOpName interface
* @tc.desc
*/
it('Telephony_Sim_getDefaultVoiceSimId_Promise_0100', 0, async function (done) {
let promise = sim.getDefaultVoiceSimId();
promise.then(data => {
console.info("Telephony_Sim_getDefaultVoiceSimId_Promise_0100 data = " + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch(err => {
console.info("Telephony_Sim_getDefaultVoiceSimId_Promise_0100 err = " + JSON.stringify(err));
radio.isRadioOn(0, (err, data) => {
console.info('Telephony_Sim_getDefaultVoiceSimId_Promise_0100 isRadioOn err' + JSON.stringify(err) + ' data ' + JSON.stringify(data));
if (!err) {
expect().assertFail();
}
});
done();
});
});
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册