23 lines
480 B
Go
23 lines
480 B
Go
|
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, "")
|
||
|
}
|