示例#1
0
        public void CheckRegularExpressionTest1()
        {
            // RegexField is null
            RibbonDefinition obj = new ValidationHelperTester();

            ValidationHelper.Current.CheckRegularExpression(obj, "RegexField", "[A-Za-z]+");

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#2
0
        public void CheckIntRangeTest1()
        {
            // RangeField is null
            RibbonDefinition obj = new ValidationHelperTester();

            ValidationHelper.Current.CheckIntRange(obj, "RangeField", 1, 9);

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#3
0
        public void CheckRequiredTest1()
        {
            // RequiredField is null
            RibbonDefinition obj = new ValidationHelperTester();

            ValidationHelper.Current.CheckNotNull(obj, "RequiredField");

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#4
0
        public void CheckArrayTest1()
        {
            // ArrayField is null
            RibbonDefinition obj = new ValidationHelperTester();

            ValidationHelper.Current.CheckArrayHasElements(obj, "ArrayField");

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#5
0
        public void CheckIntRangeTest3()
        {
            // RangeField is in range
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RangeField = 5
            };

            ValidationHelper.Current.CheckIntRange(obj, "RangeField", 1, 9);
        }
示例#6
0
        public void CheckRequiredTest2()
        {
            // RequiredField is not null
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RequiredField = String.Empty
            };

            ValidationHelper.Current.CheckNotNull(obj, "RequiredField");
        }
示例#7
0
        public void CheckArrayTest3()
        {
            // ArrayField filled properly
            RibbonDefinition obj = new ValidationHelperTester()
            {
                ArrayField = new TabDefinition[] { new TabDefinition() }
            };

            ValidationHelper.Current.CheckArrayHasElements(obj, "ArrayField");
        }
示例#8
0
        public void CheckRegularExpressionTest4()
        {
            // RegexField is null
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RegexField = "Good Test"
            };

            ValidationHelper.Current.CheckRegularExpression(obj, "RegexField", "[A-Za-z]+");
        }
示例#9
0
        public void CheckIntRangeTest1()
        {
            ValidationHelper_Accessor target = new ValidationHelper_Accessor();

            // RangeField is null
            RibbonDefinition obj = new ValidationHelperTester();

            target.CheckIntRange(obj, "RangeField", 1, 9);

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#10
0
        public void CheckRequiredTest1()
        {
            ValidationHelper_Accessor target = new ValidationHelper_Accessor();

            // RequiredField is null
            RibbonDefinition obj = new ValidationHelperTester();

            target.CheckNotNull(obj, "RequiredField");

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#11
0
        public void CheckIntRangeTest3()
        {
            ValidationHelper_Accessor target = new ValidationHelper_Accessor();
            // RangeField is in range
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RangeField = 5
            };

            target.CheckIntRange(obj, "RangeField", 1, 9);
        }
示例#12
0
        public void CheckArrayTest3()
        {
            ValidationHelper_Accessor target = new ValidationHelper_Accessor();

            // ArrayField filled properly
            RibbonDefinition obj = new ValidationHelperTester()
            {
                ArrayField = new TabDefinition[] { new TabDefinition() }
            };

            target.CheckArrayHasElements(obj, "ArrayField");
        }
示例#13
0
        public void CheckRegularExpressionTest4()
        {
            ValidationHelper_Accessor target = new ValidationHelper_Accessor();

            // RegexField is null
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RegexField = "Good Test"
            };

            target.CheckRegularExpression(obj, "RegexField", "[A-Za-z]+");
        }
示例#14
0
        public void CheckRequiredTest2()
        {
            ValidationHelper_Accessor target = new ValidationHelper_Accessor();

            // RequiredField is not null
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RequiredField = String.Empty
            };

            target.CheckNotNull(obj, "RequiredField");
        }
示例#15
0
        public void CheckIntRangeTest2()
        {
            // RangeField is outside of the range
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RangeField = -1
            };

            ValidationHelper.Current.CheckIntRange(obj, "RangeField", 1, 9);

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#16
0
        public void CheckArrayTest2()
        {
            // ArrayField is empty array
            RibbonDefinition obj = new ValidationHelperTester()
            {
                ArrayField = new TabDefinition[] { }
            };

            ValidationHelper.Current.CheckArrayHasElements(obj, "ArrayField");

            Assert.Fail("Expected ValidationException was not thrown!");
        }
示例#17
0
        public void CheckRegularExpressionTest2()
        {
            // RegexField has invalid characters
            RibbonDefinition obj = new ValidationHelperTester()
            {
                RegexField = "Bad.Test"
            };

            ValidationHelper.Current.CheckRegularExpression(obj, "RegexField", "[A-Za-z]+");

            Assert.Fail("Expected ValidationException was not thrown!");
        }