Пример #1
0
func TestDurationValidateErrors(t *testing.T) {
	vasttest.VerifyVastElementErrorAsExpected(t, vast.Duration(-time.Hour), vast.Duration(-time.Hour).Validate(), vast.ErrDurationNegative)
	vasttest.VerifyVastElementErrorAsExpected(t, vast.Duration(0), vast.Duration(0).Validate(), vast.ErrDurationEqualZero)
	vasttest.VerifyVastElementErrorAsExpected(t, vast.Duration(time.Hour), vast.Duration(time.Hour).Validate(), nil)
}
Пример #2
0
func TestOffsetValidateErrors(t *testing.T) {
	for _, test := range offsetValidTests {
		vasttest.VerifyVastElementErrorAsExpected(t, test.VastElement, test.VastElement.Validate(), test.Err)
	}
}