error_test.go 470 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
package kevin

import (
	"errors"
	"testing"
)

func TestIsKevinError(t *testing.T) {
	if !IsKevinError(ErrScheduleNotFound) {
		t.Error("Expected a Kevin error.")
	}

13 14 15 16 17
	e := new(error)
	if IsKevinError(*e) {
		t.Error("Any other error is not a Kevin error.")
	}

18 19 20
	if IsKevinError(errors.New("http://www.kylehq.com")) {
		t.Error("New error is not a Kevin error.")
	}
21 22 23 24

	if "" == ErrScheduleNotFound.Error() {
		t.Error("Errors should return a valid error message.")
	}
25
}