Exemple #1
0
        public void RecordFieldUtility_ApplySubField_2()
        {
            RecordField field1 = new RecordField();
            RecordField field2 = RecordFieldUtility.ApplySubField
                                 (
                field1,
                'a',
                (object)"SubA"
                                 );

            Assert.AreSame(field1, field2);
            Assert.AreEqual(1, field1.SubFields.Count);

            RecordField field3 = RecordFieldUtility.ApplySubField
                                 (
                field1,
                'a',
                (object)null
                                 );

            Assert.AreSame(field1, field3);
            Assert.AreEqual(0, field1.SubFields.Count);

            RecordField field4 = RecordFieldUtility.ApplySubField
                                 (
                field1,
                '\0',
                (object)"Sub0"
                                 );

            Assert.AreSame(field1, field4);
            Assert.AreEqual(0, field1.SubFields.Count);
        }
Exemple #2
0
        public void RecordFieldUtility_ApplySubField_3()
        {
            RecordField field1 = new RecordField();
            RecordField field2 = RecordFieldUtility.ApplySubField
                                 (
                field1,
                'a',
                true,
                "SubA"
                                 );

            Assert.AreSame(field1, field2);
            Assert.AreEqual(1, field1.SubFields.Count);

            RecordField field3 = RecordFieldUtility.ApplySubField
                                 (
                field1,
                'a',
                false,
                "SubA"
                                 );

            Assert.AreSame(field1, field3);
            Assert.AreEqual(0, field1.SubFields.Count);

            RecordField field4 = RecordFieldUtility.ApplySubField
                                 (
                field1,
                '\0',
                true,
                "Sub0"
                                 );

            Assert.AreSame(field1, field4);
            Assert.AreEqual(0, field1.SubFields.Count);
        }