...
1 package flagutil
2
3 import (
4 "testing"
5
6 "github.com/stretchr/testify/assert"
7 )
8
9 var (
10 ntp = "ntp"
11 kubevip = "kube-vip"
12 dns = "dns"
13 invalidType = "invalid-service-type"
14 )
15
16 func TestValidServiceType_NTP(t *testing.T) {
17 assert.True(t, IsValidServiceType(ntp))
18 }
19
20 func TestValidServiceType_KubeVip(t *testing.T) {
21 assert.True(t, IsValidServiceType(kubevip))
22 }
23
24 func TestValidServiceType_DNS(t *testing.T) {
25 assert.True(t, IsValidServiceType(dns))
26 }
27
28 func TestValidServiceType_invalid(t *testing.T) {
29 assert.False(t, IsValidServiceType(invalidType))
30 }
31
View as plain text