diff --git a/aggsender/types/status_test.go b/aggsender/types/status_test.go new file mode 100644 index 00000000..d48ca004 --- /dev/null +++ b/aggsender/types/status_test.go @@ -0,0 +1,16 @@ +package types + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestAggsenderStatusSetLastError(t *testing.T) { + sut := AggsenderStatus{} + sut.SetLastError(nil) + require.Equal(t, "", sut.LastError) + sut.SetLastError(errors.New("error")) + require.Equal(t, "error", sut.LastError) +} diff --git a/version_test.go b/version_test.go new file mode 100644 index 00000000..de56296d --- /dev/null +++ b/version_test.go @@ -0,0 +1,18 @@ +package cdk + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGetVersion(t *testing.T) { + data := GetVersion() + require.True(t, len(data.Version) > 0) + require.True(t, len(data.GitRev) > 0) + require.True(t, len(data.GitBranch) > 0) + require.True(t, len(data.BuildDate) > 0) + require.True(t, len(data.GoVersion) > 0) + require.True(t, len(data.OS) > 0) + require.True(t, len(data.Arch) > 0) +}