Example #1
0
        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);
        }
Example #2
0
        public void For_WithoutName_Throws()
        {
            var validatorStub = new FooValidator();

            Assert.Throws <ArgumentNullException>(() => validatorStub.For <string>(p => p.Bar, null));
        }
Example #3
0
        public void For_WithoutValueExpression_Throws()
        {
            var validatorStub = new FooValidator();

            Assert.Throws <ArgumentNullException>(() => validatorStub.For <string>(null, nameof(Foo.Bar)));
        }