screen_test.go 643 B

12345678910111213141516171819202122
  1. package dao
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. )
  6. // TestDao_CalPassScTime
  7. func TestDao_CalPassScTime(t *testing.T) {
  8. Convey("CalPassScTime", t, func() {
  9. once.Do(startService)
  10. startTimes := map[int32]int32{0: 1530860100, 1: 1530860122}
  11. endTimes := map[int32]int32{0: 1533365702, 1: 1533970523}
  12. var tksPass []TicketPass
  13. tksPass = append(tksPass, TicketPass{Name: "test1", LinkScreens: []int32{0, 1}})
  14. tksPass = append(tksPass, TicketPass{Name: "test2", LinkScreens: []int32{0, 1}})
  15. res, err := d.CalPassScTime(startTimes, endTimes, tksPass)
  16. So(res, ShouldNotBeNil)
  17. So(err, ShouldBeNil)
  18. })
  19. }