error_test.go 302 字节
Newer Older
W
wangzelin.wzl 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package errors

import (
	"strconv"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestErrorOccur(t *testing.T) {
	e := ErrUnexpected
	args := "unexpected"
	err := Occur(e, args)
	message := err.Error()
	assert.Contains(t, message, strconv.Itoa(e.Code))
	assert.Contains(t, message, args)
}