소스 검색

checkgin empty field for events

master
Patrick Peng Sun 8 년 전
부모
커밋
ffbe0fb56f
1개의 변경된 파일22개의 추가작업 그리고 1개의 파일을 삭제
  1. +22
    -1
      inMsg_test.go

+ 22
- 1
inMsg_test.go 파일 보기

@@ -188,6 +188,10 @@ func TestReadEventClick(t *testing.T) {
m := ReadEventMsg(msg)
AssertEqual(t, m.Event, "CLICK", "Expect Click event")
AssertEqual(t, m.EventKey, "MEMBER_SEARCH", "Expect MEMBER_SEARCH")
AssertEqual(t, m.Ticket, "", "Expect Empty Ticket")
AssertEqual(t, m.Latitude, 0.0, "Expect 0")
AssertEqual(t, m.Longitude, 0.0, "Expect 0")
AssertEqual(t, m.Precision, 0.0, "Expect 0")
}

func TestAcceptLocationInfo(t *testing.T) {
@@ -226,6 +230,9 @@ func TestAcceptLocationInfo(t *testing.T) {
AssertEqual(t, m.Longitude, 150.960327, "Expect 150.960327")
AssertEqual(t, m.Latitude, -33.764935, "Expect -33.764935")
AssertEqual(t, m.Precision, 110.000000, "Expect 110.000000")
AssertEqual(t, m.EventKey, "", "Expect Empty EventKey")
AssertEqual(t, m.Ticket, "", "Expect Empty Ticket")

}

func TestReadEventFollow(t *testing.T) {
@@ -238,6 +245,11 @@ func TestReadEventFollow(t *testing.T) {
</xml>`
m := ReadEventMsg(msg)
AssertEqual(t, m.Event, "subscribe", "Expect subscribe")
AssertEqual(t, m.EventKey, "", "Expect Empty EventKey")
AssertEqual(t, m.Ticket, "", "Expect Empty Ticket")
AssertEqual(t, m.Latitude, 0.0, "Expect 0")
AssertEqual(t, m.Longitude, 0.0, "Expect 0")
AssertEqual(t, m.Precision, 0.0, "Expect 0")

}

@@ -254,6 +266,9 @@ func TestReadEventScanNoFollow(t *testing.T) {
AssertEqual(t, m.Event, "subscribe", "Expect subscribe")
AssertEqual(t, m.EventKey, "qrscene_123123", "Expect qrscene_123123")
AssertEqual(t, m.Ticket, "TICKET", "Expect TICKET")
AssertEqual(t, m.Latitude, 0.0, "Expect 0")
AssertEqual(t, m.Longitude, 0.0, "Expect 0")
AssertEqual(t, m.Precision, 0.0, "Expect 0")

}

@@ -271,6 +286,9 @@ func TestReadEventScanWithFollow(t *testing.T) {
AssertEqual(t, m.Event, "SCAN", "Expect SCAN")
AssertEqual(t, m.EventKey, "SCENE_VALUE", "Expect SCENE_VALUE")
AssertEqual(t, m.Ticket, "TICKET", "Expect TICKET")
AssertEqual(t, m.Latitude, 0.0, "Expect 0")
AssertEqual(t, m.Longitude, 0.0, "Expect 0")
AssertEqual(t, m.Precision, 0.0, "Expect 0")

}

@@ -286,6 +304,9 @@ func TestReadEventView(t *testing.T) {
m := ReadEventMsg(msg)
AssertEqual(t, m.Event, "VIEW", "Expect VIEW")
AssertEqual(t, m.EventKey, "www.qq.com", "Expectwww.qq.com")
AssertEqual(t, m.Ticket, "", "Expect empty ")
AssertEqual(t, m.Ticket, "", "Expect Empty Ticket")
AssertEqual(t, m.Latitude, 0.0, "Expect 0")
AssertEqual(t, m.Longitude, 0.0, "Expect 0")
AssertEqual(t, m.Precision, 0.0, "Expect 0")

}

Loading…
취소
저장