...
1 package ldmodel
2
3 import (
4 "testing"
5
6 "github.com/stretchr/testify/assert"
7 )
8
9 func TestRolloutIsExperiment(t *testing.T) {
10 r := Rollout{}
11 assert.False(t, r.IsExperiment(), `rollout with undefined kind is not an experiment`)
12
13 r = Rollout{Kind: RolloutKind("bogus")}
14 assert.False(t, r.IsExperiment(), `rollout with bogus kind is not an experiment`)
15
16 r = Rollout{Kind: RolloutKindRollout}
17 assert.False(t, r.IsExperiment(), `rollout with kind "rollout" is not an experiment`)
18
19 r = Rollout{Kind: RolloutKindExperiment}
20 assert.True(t, r.IsExperiment())
21 }
22
View as plain text