提交 3c8ee450 编写于 作者: Z zhangfuzhi

modfiy telephony case

Signed-off-by: Nzhangfuzhi <zhangfuzhi1@huawei.com>
上级 56b3937e
...@@ -417,7 +417,7 @@ export default function ObjectInterfaceTest() { ...@@ -417,7 +417,7 @@ export default function ObjectInterfaceTest() {
try { try {
var resultSet = await contactsapi.queryContact(queryId); var resultSet = await contactsapi.queryContact(queryId);
console.info("contactsApi_query_contact_test_400 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_contact_test_400 : query resultSet = " + JSON.stringify(resultSet));
expect(resultSet != null).assertTrue(); expect(resultSet == undefined).assertTrue();
done(); done();
} catch (error) { } catch (error) {
console.info("contactsApi_query_contact_test_400 query error = " + error); console.info("contactsApi_query_contact_test_400 query error = " + error);
...@@ -437,7 +437,7 @@ export default function ObjectInterfaceTest() { ...@@ -437,7 +437,7 @@ export default function ObjectInterfaceTest() {
done(); done();
return; return;
} }
var queryId = gRawContactId.toString(); var queryId = gRawContactId;
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
} }
...@@ -445,7 +445,8 @@ export default function ObjectInterfaceTest() { ...@@ -445,7 +445,8 @@ export default function ObjectInterfaceTest() {
expect(holder.displayName === null).assertFalse(); expect(holder.displayName === null).assertFalse();
expect(holder.holderId != 0).assertTrue(); expect(holder.holderId != 0).assertTrue();
try { try {
var resultSet = await contactsapi.queryContact(queryId, holder); var findKey = contactsapi.queryKey(queryId);
var resultSet = await contactsapi.queryContact(findKey, holder);
console.info("contactsApi_query_contact_test_500 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_contact_test_500 : query resultSet = " + JSON.stringify(resultSet));
expect(resultSet === null).assertFalse(); expect(resultSet === null).assertFalse();
done(); done();
...@@ -467,7 +468,7 @@ export default function ObjectInterfaceTest() { ...@@ -467,7 +468,7 @@ export default function ObjectInterfaceTest() {
done(); done();
return; return;
} }
var queryId = gRawContactId.toString(); var queryId = gRawContactId;
var holder = { var holder = {
bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1 bundleName: "com.ohos.contacts", displayName: "phone", holderId: 1
}; };
...@@ -475,7 +476,8 @@ export default function ObjectInterfaceTest() { ...@@ -475,7 +476,8 @@ export default function ObjectInterfaceTest() {
attributes: [1, 5, 6] attributes: [1, 5, 6]
} }
try { try {
var resultSet = await contactsapi.queryContact(queryId, holder, ContactAttributes); var findKey = contactsapi.queryKey(queryId);
var resultSet = await contactsapi.queryContact(findKey, holder, ContactAttributes);
console.info("contactsApi_query_contact_test_600 : query resultSet = " + JSON.stringify(resultSet)); console.info("contactsApi_query_contact_test_600 : query resultSet = " + JSON.stringify(resultSet));
expect(resultSet === null).assertFalse(); expect(resultSet === null).assertFalse();
done(); done();
...@@ -1051,7 +1053,7 @@ export default function ObjectInterfaceTest() { ...@@ -1051,7 +1053,7 @@ export default function ObjectInterfaceTest() {
try { try {
var updateCode = await contactsapi.updateContact(updateValues, condition); var updateCode = await contactsapi.updateContact(updateValues, condition);
console.info("abnormal_contactsApi_update_test_3000 : updateCode = " + updateCode); console.info("abnormal_contactsApi_update_test_3000 : updateCode = " + updateCode);
expect(updateCode === -1).assertFalse(); expect(updateCode === -1).assertTrue();
done(); done();
} catch (error) { } catch (error) {
console.info("abnormal_contactsApi_update_test_3000 : update error = " + error); console.info("abnormal_contactsApi_update_test_3000 : update error = " + error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册