예제 #1
0
        public void RecordFieldUtility_GetFieldRegex_6()
        {
            IEnumerable <RecordField> enumeration = _GetFieldEnumeration();

            int[]       tags      = { 100, 200 };
            string      textRegex = "^Sub";
            RecordField field     = RecordFieldUtility.GetFieldRegex(enumeration, tags, textRegex, 0);

            Assert.IsNull(field);
        }
예제 #2
0
        public void RecordFieldUtility_GetFieldRegex_5()
        {
            IEnumerable <RecordField> enumeration = _GetFieldEnumeration();

            int[]  tags      = { 100, 200 };
            string textRegex = "^Sub";

            RecordField[] fields = RecordFieldUtility.GetFieldRegex(enumeration, tags, textRegex);
            Assert.AreEqual(0, fields.Length);
        }
예제 #3
0
        public void RecordFieldUtility_GetFieldRegex_1()
        {
            IEnumerable <RecordField> enumeration = _GetFieldEnumeration();

            RecordField[] fields = RecordFieldUtility.GetFieldRegex(enumeration, "^[12]");
            Assert.AreEqual(4, fields.Length);

            enumeration = _GetFieldEnumeration();
            fields      = RecordFieldUtility.GetFieldRegex(enumeration, "^[89]");
            Assert.AreEqual(0, fields.Length);
        }
예제 #4
0
        public void RecordFieldUtility_GetFieldRegex_8()
        {
            IEnumerable <RecordField> enumeration = new []
            {
                new RecordField(100, "Field100"),
                new RecordField(200, "TheField200"),
            };

            int[]       tags      = { 100, 200 };
            string      textRegex = "^Field";
            RecordField field     = RecordFieldUtility.GetFieldRegex(enumeration, tags, textRegex, 0);

            Assert.IsNotNull(field);
        }
예제 #5
0
        public void RecordFieldUtility_GetFieldRegex_7()
        {
            IEnumerable <RecordField> enumeration = new []
            {
                new RecordField(100, "Field100"),
                new RecordField(200, "TheField200"),
            };

            int[]  tags      = { 100, 200 };
            string textRegex = "^Field";

            RecordField[] fields = RecordFieldUtility.GetFieldRegex(enumeration, tags, textRegex);
            Assert.AreEqual(1, fields.Length);
        }
예제 #6
0
        public void RecordFieldUtility_GetFieldRegex_2()
        {
            IEnumerable <RecordField> enumeration = _GetFieldEnumeration();
            RecordField field = RecordFieldUtility.GetFieldRegex(enumeration, "^[12]", 2);

            Assert.IsNotNull(field);

            enumeration = _GetFieldEnumeration();
            field       = RecordFieldUtility.GetFieldRegex(enumeration, "^[12]", 5);
            Assert.IsNull(field);

            enumeration = _GetFieldEnumeration();
            field       = RecordFieldUtility.GetFieldRegex(enumeration, "^[89]", 0);
            Assert.IsNull(field);
        }