Passed
Push — main ( 2a46cd...12059c )
by Igor
01:41
created

test/path_test.go   A

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 13
dl 0
loc 21
c 0
b 0
f 0
rs 10
1
package test
2
3
import (
4
	"testing"
5
6
	"github.com/muonsoft/validation/code"
7
	"github.com/muonsoft/validation/it"
8
	"github.com/muonsoft/validation/message"
9
	"github.com/muonsoft/validation/validator"
10
)
11
12
func TestValidate_AtProperty_WhenGivenProperty_ExpectViolationWithProperty(t *testing.T) {
13
	err := validator.AtProperty("property").ValidateString(stringValue(""), it.IsNotBlank())
14
15
	assertHasOneViolation(code.NotBlank, message.NotBlank, "property")(t, err)
16
}
17
18
func TestValidate_AtIndex_WhenGivenIndex_ExpectViolationWithIndex(t *testing.T) {
19
	err := validator.AtIndex(1).ValidateString(stringValue(""), it.IsNotBlank())
20
21
	assertHasOneViolation(code.NotBlank, message.NotBlank, "[1]")(t, err)
22
}
23