Exemple #1
0
        public void CompileTimeValidation_ParameterLessIndex_ReturnsFalseSetsMessage()
        {
            //setup
            var attr = new ParameterNotNullCheckAttribute(9);
            //act
            var ret = attr.CompileTimeValidate(typeof(MethodCheckSample).GetMethod("SimpleOneParameterString"));

            //assert
            Assert.That(ret, new FalseConstraint());
        }
Exemple #2
0
        public void CompileTimeValidation_NoParameter_ReturnsFalseSetsMessage()
        {
            //setup
            var attr = new ParameterNotNullCheckAttribute(9);
            //act
            var ret = attr.CompileTimeValidate(this.GetType().GetMethod("CompileTimeValidation_NoParameter_ReturnsFalseSetsMessage"));

            //assert
            Assert.That(ret, new FalseConstraint());
        }
        public void CompileTimeValidation_ParameterLessIndex_ReturnsFalseSetsMessage()
        {
            //setup
            var attr = new ParameterNotNullCheckAttribute(9);
            //act
            var ret = attr.CompileTimeValidate(typeof(MethodCheckSample).GetMethod("SimpleOneParameterString"));

            //assert
            Assert.That(ret, new FalseConstraint());
        }
        public void CompileTimeValidation_NothingSet_ReturnsFalseSetsMessage()
        {
            //setup
            var attr = new ParameterNotNullCheckAttribute(9);
            attr.ParameterName = null;
            //act
            var ret = attr.CompileTimeValidate(this.GetType().GetMethod("CompileTimeValidation_NothingSet_ReturnsFalseSetsMessage"));

            //assert
            Assert.That(ret, new FalseConstraint());
        }