Просмотр исходного кода

match another attribute

master
Patrick Peng Sun 8 лет назад
Родитель
Сommit
250fe57201
1 измененных файлов: 10 добавлений и 1 удалений
  1. +10
    -1
      crmEntity_test.go

+ 10
- 1
crmEntity_test.go Просмотреть файл

@@ -182,13 +182,22 @@ func TestSearchByAttr(t *testing.T) {

//search
for i := 0; i < 10; i++ {
log.Printf("trying to match %d , %s", i, ids[i])
log.Printf("trying to match %d using email, %s", i, ids[i])
total, list, err := crmFindEntityByAttr("Lead", "emailAddress", fmt.Sprintf("abc%d@gmail.com", i))
result := list.([]crmdLead)
AssertEqual(t, err, nil, "find by attr should have no error")
AssertEqual(t, total, 1, "should have found 1 and only 1")
AssertEqual(t, len(result), 1, "list should be 1 ")
AssertEqual(t, result[0].ID, ids[i], "the id should be correct.")

log.Printf("trying to match %d using WechatId,%s", i, ids[i])
total, list, err = crmFindEntityByAttr("Lead", "wechat_hitxy_id", fmt.Sprintf("someopenid-%d", i))
result = list.([]crmdLead)
AssertEqual(t, err, nil, "find by attr should have no error")
AssertEqual(t, total, 1, "should have found 1 and only 1")
AssertEqual(t, len(result), 1, "list should be 1 ")
AssertEqual(t, result[0].ID, ids[i], "the id should be correct.")

}

for i := 0; i < 10; i++ {

Загрузка…
Отмена
Сохранить