-
Notifications
You must be signed in to change notification settings - Fork 68
/
state_test.go
27 lines (23 loc) · 907 Bytes
/
state_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package moira
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestTtlState_ToMetricState(t *testing.T) {
Convey("ToMetricState test", t, func() {
So(TTLStateDEL.ToMetricState(), ShouldResemble, StateNODATA)
So(TTLStateOK.ToMetricState(), ShouldResemble, StateOK)
So(TTLStateWARN.ToMetricState(), ShouldResemble, StateWARN)
So(TTLStateERROR.ToMetricState(), ShouldResemble, StateERROR)
So(TTLStateNODATA.ToMetricState(), ShouldResemble, StateNODATA)
})
}
func TestTtlState_ToTriggerState(t *testing.T) {
Convey("ToTriggerState test", t, func() {
So(TTLStateDEL.ToTriggerState(), ShouldResemble, StateOK)
So(TTLStateOK.ToTriggerState(), ShouldResemble, StateOK)
So(TTLStateWARN.ToTriggerState(), ShouldResemble, StateWARN)
So(TTLStateERROR.ToTriggerState(), ShouldResemble, StateERROR)
So(TTLStateNODATA.ToTriggerState(), ShouldResemble, StateNODATA)
})
}