1
0
Fork 0
hswro-alarm-bot/satel_utils_test.go

23 lines
480 B
Go
Raw Permalink Normal View History

2024-02-18 17:44:08 +00:00
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStringToSatelChangeType(t *testing.T) {
for _, ct := range SUPPORTED_CHANGE_TYPES {
str := ct.String()
new_ct, err := StringToSatelChangeType(str)
assert.NoError(t, err)
assert.Equal(t, ct, new_ct)
assert.Equal(t, new_ct.String(), str)
}
}
func TestStringToSatelChangeType_UnknownStringPanics(t *testing.T) {
_, err := StringToSatelChangeType("smród")
assert.Error(t, err, "")
}