示例#1
0
func TestCheckMessage(t *testing.T) {
	repository := cron.NewOnMemoryCronRepository()
	p := cron.NewPlugin(cron.NewCronContext(repository))
	for _, testEvent := range testEvents {
		ok, _ := p.CheckMessage(testEvent, testEvent.BaseText())
		if !ok {
			t.Errorf("ERROR check = NG")
		}
	}
}
示例#2
0
func TestDoAction(t *testing.T) {
	repository := cron.NewOnMemoryCronRepository()
	p := cron.NewPlugin(cron.NewCronContext(repository))

	for _, testEvent := range testEvents {
		next := p.DoAction(testEvent, testEvent.BaseText())
		if next != false {
			t.Errorf("ERROR next != false")
		}
	}
}