message_test.go 661 B

12345678910111213141516171819202122232425
  1. package service
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. )
  6. func Test_shouldNofify(t *testing.T) {
  7. Convey("get data", t, func() {
  8. So(shouldNofify(0), ShouldBeFalse)
  9. So(shouldNofify(1), ShouldBeTrue)
  10. So(shouldNofify(5), ShouldBeTrue)
  11. So(shouldNofify(10), ShouldBeTrue)
  12. So(shouldNofify(15), ShouldBeFalse)
  13. So(shouldNofify(50), ShouldBeTrue)
  14. So(shouldNofify(55), ShouldBeFalse)
  15. So(shouldNofify(201), ShouldBeFalse)
  16. So(shouldNofify(300), ShouldBeTrue)
  17. So(shouldNofify(1010), ShouldBeFalse)
  18. So(shouldNofify(10000), ShouldBeTrue)
  19. So(shouldNofify(20000), ShouldBeTrue)
  20. So(shouldNofify(21000), ShouldBeFalse)
  21. })
  22. }