gomonop/pkg/results/status_test.go
Emmanuel BENOîT 1a29325c34
refactor(pkg): rename internals so their names actually make sense
A "program" was in fact a plugin, while a "plugin" represented the
plugin's results.
2024-07-20 00:20:28 +02:00

26 lines
647 B
Go

package results // import nocternity.net/gomonop/pkg/results
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStatusDefaultOK(t *testing.T) {
var s Status
assert.Equal(t, StatusOK, s)
}
func TestStatusToString(t *testing.T) {
assert.Equal(t, "OK", StatusOK.String())
assert.Equal(t, "WARNING", StatusWarning.String())
assert.Equal(t, "ERROR", StatusCritical.String())
assert.Equal(t, "UNKNOWN", StatusUnknown.String())
}
func TestStatusToInt(t *testing.T) {
assert.Equal(t, 0, int(StatusOK))
assert.Equal(t, 1, int(StatusWarning))
assert.Equal(t, 2, int(StatusCritical))
assert.Equal(t, 3, int(StatusUnknown))
}