zitadel/internal/errors/caos_error_test.go

20 lines
463 B
Go
Raw Normal View History

2020-03-18 14:45:24 +00:00
package errors_test
import (
"testing"
"github.com/stretchr/testify/assert"
2020-03-23 05:34:08 +00:00
caos_errs "github.com/caos/zitadel/internal/errors"
2020-03-18 14:45:24 +00:00
)
func TestErrorMethod(t *testing.T) {
err := caos_errs.ThrowError(nil, "id", "msg")
expected := "ID=id Message=msg"
assert.Equal(t, expected, err.Error())
err = caos_errs.ThrowError(err, "subID", "subMsg")
subExptected := "ID=subID Message=subMsg Parent=(ID=id Message=msg)"
assert.Equal(t, subExptected, err.Error())
}