diff options
Diffstat (limited to 'internal/service/config_test.go')
-rw-r--r-- | internal/service/config_test.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/internal/service/config_test.go b/internal/service/config_test.go deleted file mode 100644 index c9af1e7..0000000 --- a/internal/service/config_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package service - -import ( - "encoding/json" - "testing" - "time" - - "github.com/stretchr/testify/require" -) - -func TestDurationMarshal(t *testing.T) { - tests := []struct { - arg Duration - exp string - }{ - { - Duration{time.Second}, - "\"1s\"", - }, - { - Duration{time.Minute}, - "\"1m0s\"", - }, - } - - for _, test := range tests { - v, err := json.Marshal(test.arg) - require.NoError(t, err) - require.Equal(t, test.exp, string(v)) - } -} - -func TestDurationUnmarshal(t *testing.T) { - tests := []struct { - arg string - exp Duration - }{ - { - "\"1s\"", - Duration{time.Second}, - }, - { - "\"1m0s\"", - Duration{time.Minute}, - }, - } - - for _, test := range tests { - var v Duration - err := json.Unmarshal([]byte(test.arg), &v) - require.NoError(t, err) - require.Equal(t, test.exp.Duration, v.Duration) - } -} |