Ejemplo n.º 1
0
        public void FormatFieldTest()
        {
            string          tag       = "600";
            List <Subfield> subfields = new List <Subfield>();
            Subfield        subfield  = new Subfield('a', "It's a book!");

            subfields.Add(subfield);
            subfield = new Subfield('b', "Anne Author");
            subfields.Add(subfield);
            subfield = new Subfield('c', "Some text");
            subfields.Add(subfield);
            subfield = new Subfield('d', "Some more text");
            subfields.Add(subfield);
            subfield = new Subfield('v', "Some fancy text");
            subfields.Add(subfield);
            subfield = new Subfield('z', "Some more fancy text");
            subfields.Add(subfield);
            DataField target = new DataField(tag, subfields);

            char[] excludeCodes = { 'a', 'b' };
            string expected     = "Some text Some more text -- Some fancy text -- Some more fancy text";
            string actual       = target.FormatField(excludeCodes);

            Assert.AreEqual(expected, actual);
        }