added validation fixes
This commit is contained in:
parent
fc38e56373
commit
9d32c5a29b
2 changed files with 23 additions and 2 deletions
|
@ -26,9 +26,13 @@ func Test_IsValid(t *testing.T) {
|
|||
t.Errorf("sut expected to be valid: %v\n", sut.Validate())
|
||||
}
|
||||
sut = Sut{valid: false}
|
||||
if res, _ := IsValid(sut); res {
|
||||
res, err := IsValid(sut)
|
||||
if res {
|
||||
t.Errorf("sut expected to be invalid: %v\n", sut.Validate())
|
||||
}
|
||||
if err == nil || !IsErrNotValid(err) || err.Error() != "Validation Error: validation.Sut: invalid" {
|
||||
t.Errorf("validation error expected, but was %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func Test_ValidateNotEmpty_ForString(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue