Make the validation types match the pending ReasonCauses

This commit is contained in:
Clayton Coleman
2014-08-19 22:57:48 -04:00
parent 7332241c0d
commit 60126bfe64
3 changed files with 84 additions and 42 deletions

View File

@@ -24,23 +24,27 @@ import (
func TestMakeFuncs(t *testing.T) {
testCases := []struct {
fn func() ValidationError
expected ValidationErrorEnum
expected ValidationErrorType
}{
{
func() ValidationError { return NewInvalid("f", "v") },
Invalid,
ValidationErrorTypeInvalid,
},
{
func() ValidationError { return NewNotSupported("f", "v") },
NotSupported,
ValidationErrorTypeNotSupported,
},
{
func() ValidationError { return NewDuplicate("f", "v") },
Duplicate,
ValidationErrorTypeDuplicate,
},
{
func() ValidationError { return NewNotFound("f", "v") },
NotFound,
ValidationErrorTypeNotFound,
},
{
func() ValidationError { return NewRequired("f", "v") },
ValidationErrorTypeRequired,
},
}