Esempio n. 1
0
        public void AddFields()
        {
            int tag1 = 245;

            string[] indicators1 = new string[2] {
                "1", "0"
            };
            List <string> subfields1 = new List <string> {
                "a", "Python", "c", "Guido"
            };
            MARCField newField1 = new MARCField(tag1, indicators1, subfields1, "");

            int tag2 = 245;

            string[] indicators2 = new string[2] {
                "1", "0"
            };
            List <string> subfields2 = new List <string> {
                "a", "Lisp", "c", "Norvig"
            };
            MARCField newField2 = new MARCField(tag2, indicators2, subfields2, "");

            MARCRecord record = new MARCRecord();

            record.AddFields(new MARCField[2] {
                newField1, newField2
            });
            Assert.Contains(newField1, record.Fields);

            Assert.Contains(newField2, record.Fields);
        }
Esempio n. 2
0
        public void GetField()
        {
            MARCRecord record = new MARCRecord();

            int tag1 = 650;

            string[] indicators1 = new string[2] {
                "", "0"
            };
            List <string> subfields1 = new List <string> {
                "a", "Pogramming Language"
            };
            MARCField subject1 = new MARCField(tag1, indicators1, subfields1, "");

            int tag2 = 650;

            string[] indicators2 = new string[2] {
                "", "0"
            };
            List <string> subfields2 = new List <string> {
                ""
            };
            MARCField subject2 = new MARCField(tag2, indicators2, subfields2, "");

            record.AddFields(new MARCField[2] {
                subject1, subject2
            });
            MARCField[] found = record.GetField(650);
            Assert.Equals(found[0], subject1);
            Assert.Equals(found[1], subject2);
        }
Esempio n. 3
0
        public void GetFields()
        {
            MARCRecord record = new MARCRecord();

            int tag1 = 650;

            string[] indicators1 = new string[2] {
                "", "0"
            };
            List <string> subfields1 = new List <string> {
                "a", "Pogramming Language"
            };
            MARCField subject1 = new MARCField(tag1, indicators1, subfields1, "");

            int tag2 = 651;

            string[] indicators2 = new string[2] {
                "", "0"
            };
            List <string> subfields2 = new List <string> {
                "a", "Object Oriented"
            };
            MARCField subject2 = new MARCField(tag2, indicators2, subfields2, "");

            record.AddFields(new MARCField[2] {
                subject1, subject2
            });
            Dictionary <int, MARCField[]> found = record.GetFields(new int[2] {
                650, 651
            });

            Assert.Equals(found[650][0], subject1);
            Assert.Equals(found[651][0], subject2);
        }