public void For_WithMemberAndName_ReturnsMemberValidationRule() { var validatorStub = new FooValidator(); var rule = validatorStub.For(p => p.Bar, nameof(Foo.Bar)); Assert.IsType <MemberValidationRule <Foo, string> >(rule); }
public void For_WithoutName_Throws() { var validatorStub = new FooValidator(); Assert.Throws <ArgumentNullException>(() => validatorStub.For <string>(p => p.Bar, null)); }
public void For_WithoutValueExpression_Throws() { var validatorStub = new FooValidator(); Assert.Throws <ArgumentNullException>(() => validatorStub.For <string>(null, nameof(Foo.Bar))); }