From 06ef7f9efe0cdabff446150863129f1e92df1656 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Mon, 6 Sep 2021 16:34:03 -0400 Subject: [PATCH] Add test for NewEventFromResult --- core/event_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 core/event_test.go diff --git a/core/event_test.go b/core/event_test.go new file mode 100644 index 00000000..2269178a --- /dev/null +++ b/core/event_test.go @@ -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") + } +}