Beispiel #1
0
        public void Test_StringLengthPropRule_ShouldReturnDefault()
        {
            //---------------Set up test pack-------------------

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var attribute = new AutoMapStringLengthPropRuleAttribute();

            //---------------Test Result -----------------------
            Assert.IsInstanceOf <Attribute>(attribute);
            Assert.AreEqual(0, attribute.MinLength);
            Assert.AreEqual(255, attribute.MaxLength);
        }
Beispiel #2
0
        public void Test_StringLengthPropRule_ShouldSetValue()
        {
            //---------------Set up test pack-------------------
            const int minLengthValue = 5;
            const int maxLengthValue = 400;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var attribute = new AutoMapStringLengthPropRuleAttribute(minLengthValue, maxLengthValue);

            //---------------Test Result -----------------------
            Assert.IsInstanceOf <Attribute>(attribute);
            Assert.AreEqual(minLengthValue, attribute.MinLength);
            Assert.AreEqual(maxLengthValue, attribute.MaxLength);
        }
        public void Test_StringLengthPropRule_ShouldSetValue()
        {
            //---------------Set up test pack-------------------
            const int minLengthValue = 5;
            const int maxLengthValue = 400;
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var attribute = new AutoMapStringLengthPropRuleAttribute(minLengthValue,maxLengthValue);
            //---------------Test Result -----------------------
            Assert.IsInstanceOf<Attribute>(attribute);
            Assert.AreEqual(minLengthValue, attribute.MinLength);
            Assert.AreEqual(maxLengthValue, attribute.MaxLength);
        }
        public void Test_StringLengthPropRule_ShouldReturnDefault()
        {
            //---------------Set up test pack-------------------
           
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var attribute = new AutoMapStringLengthPropRuleAttribute();
            //---------------Test Result -----------------------
            Assert.IsInstanceOf<Attribute>(attribute);
            Assert.AreEqual(0, attribute.MinLength);
            Assert.AreEqual(255, attribute.MaxLength);
        }