Add test for NewEventFromResult

This commit is contained in:
TwinProduction 2021-09-06 16:34:03 -04:00
parent bfbe928173
commit 06ef7f9efe

12
core/event_test.go Normal file
View File

@ -0,0 +1,12 @@
package core
import "testing"
func TestNewEventFromResult(t *testing.T) {
if event := NewEventFromResult(&Result{Success: true}); event.Type != EventHealthy {
t.Error("expected event.Type to be EventHealthy")
}
if event := NewEventFromResult(&Result{Success: false}); event.Type != EventUnhealthy {
t.Error("expected event.Type to be EventUnhealthy")
}
}