Exemplo n.º 1
0
        public void Remove()
        {
            TextReader marcRecord       = new StreamReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\makrtest.mrc", Encoding.Default);
            string     marcTransmission = marcRecord.ReadToEnd();
            MARCRecord testRecord       = new MARCRecord(marcTransmission);

//test when only one field is present
            string removed650 = @"=LDR  01201nam  2200253 a 4500
=001  tes96000001\
=003  ViArRB
=005  199602210153555.7
=008  960221s1955\\\\dcuabcdjdbkoqu001\0deng\d
=040  \\$aViArRB$cViArRB
=050  \4$aPQ1234$b.T39 1955
=100  2\$aDeer-Doe, J.$q(Jane),$csaint,$d1355-1401,$cspirit.
=245  10$aNew test record number 1 with ordinary data$h[large print] /$cby Jane Deer-Doe ; edited by Patty O'Furniture.
=246  1\$aNew test record number one with ordinary data
=260  \\$aWashington, DC :$bLibrary of Congress,$c1955-<1957>
=300  \\$av. 1-<5> :$bill., maps, ports., charts ;$c cm.
=440  \0$aTest record series ;$vno. 1
=500  \\$aThis is a test of ordinary features like replacement of the mnemonics for currency and dollar signs and backslashes (backsolidus \) used for blanks in certain areas.
=500  \\$aThis is a test for the conversion of curly braces; the opening curly brace ({) and the closing curly brace (}).
=504  \\$aIncludes Bibliographies, discographies, filmographies, and reviews.
=500  \\$aIncludes index.
=600  14$aDoe, John,$d1955- $xBiography.
=700  1\$aO'Furniture, Patty,$eed.
";

            testRecord.RemoveField(650);
            Assert.Equals(removed650, testRecord.ToString());

//test when there are multiple of the same field
            string remove500 = @"=LDR  01201nam  2200253 a 4500
=001  tes96000001\
=003  ViArRB
=005  199602210153555.7
=008  960221s1955\\\\dcuabcdjdbkoqu001\0deng\d
=040  \\$aViArRB$cViArRB
=050  \4$aPQ1234$b.T39 1955
=100  2\$aDeer-Doe, J.$q(Jane),$csaint,$d1355-1401,$cspirit.
=245  10$aNew test record number 1 with ordinary data$h[large print] /$cby Jane Deer-Doe ; edited by Patty O'Furniture.
=246  1\$aNew test record number one with ordinary data
=260  \\$aWashington, DC :$bLibrary of Congress,$c1955-<1957>
=300  \\$av. 1-<5> :$bill., maps, ports., charts ;$c cm.
=440  \0$aTest record series ;$vno. 1
=504  \\$aIncludes Bibliographies, discographies, filmographies, and reviews.
=600  14$aDoe, John,$d1955- $xBiography.
=700  1\$aO'Furniture, Patty,$eed.
";

            testRecord.RemoveField(500);
            Assert.Equals(remove500, testRecord.ToString());
        }
Exemplo n.º 2
0
        public void RemoveFields()
        {
            TextReader marcRecord       = new StreamReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\makrtest.mrc", Encoding.Default);
            string     marcTransmission = marcRecord.ReadToEnd();
            MARCRecord testRecord       = new MARCRecord(marcTransmission);

            //test when only one field is present
            string removed650and500 = @"=LDR  01201nam  2200253 a 4500
=001  tes96000001\
=003  ViArRB
=005  199602210153555.7
=008  960221s1955\\\\dcuabcdjdbkoqu001\0deng\d
=040  \\$aViArRB$cViArRB
=050  \4$aPQ1234$b.T39 1955
=100  2\$aDeer-Doe, J.$q(Jane),$csaint,$d1355-1401,$cspirit.
=245  10$aNew test record number 1 with ordinary data$h[large print] /$cby Jane Deer-Doe ; edited by Patty O'Furniture.
=246  1\$aNew test record number one with ordinary data
=260  \\$aWashington, DC :$bLibrary of Congress,$c1955-<1957>
=300  \\$av. 1-<5> :$bill., maps, ports., charts ;$c cm.
=440  \0$aTest record series ;$vno. 1
=504  \\$aIncludes Bibliographies, discographies, filmographies, and reviews.
=600  14$aDoe, John,$d1955- $xBiography.
=700  1\$aO'Furniture, Patty,$eed.
";

            testRecord.RemoveFields(new int[2] {
                650, 500
            });
            Assert.Equals(removed650and500, testRecord.ToString());
        }