public void AnotherMultiRecordWrite()
        {
            string answer = new StreamReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\makrtest.mrk").ReadToEnd();
            MARCBreakerWriter file = new MARCBreakerWriter("breakerMultiTest2.mrk");
            MARCReader reader = new MARCReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\makrtest.mrc");
            foreach (MARCRecord record in reader) { file.Write(record); }
            file.Close();
            string result = new StreamReader("breakerMultiTest2.mrk").ReadToEnd();

            //only checks that all of the characters so far are the same, not that the strings are identical
            for (int i = 0; i < answer.Length && i < result.Length; i++)
            {
                Assert.Equals(answer[i], result[i], "difference at " + i + " of " + result.Length + "\n " + (char)answer[i] + " v. " + (char)result[i]);
            }
            Assert.Equals(answer.Length, result.Length, "The answer differs by " + (answer.Length - result.Length).ToString());

        }
Beispiel #2
0
        public void AnotherMultiRecordWrite()
        {
            string            answer = new StreamReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\makrtest.mrk").ReadToEnd();
            MARCBreakerWriter file   = new MARCBreakerWriter("breakerMultiTest2.mrk");
            MARCReader        reader = new MARCReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\makrtest.mrc");

            foreach (MARCRecord record in reader)
            {
                file.Write(record);
            }
            file.Close();
            string result = new StreamReader("breakerMultiTest2.mrk").ReadToEnd();

            //only checks that all of the characters so far are the same, not that the strings are identical
            for (int i = 0; i < answer.Length && i < result.Length; i++)
            {
                Assert.Equals(answer[i], result[i], "difference at " + i + " of " + result.Length + "\n " + (char)answer[i] + " v. " + (char)result[i]);
            }
            Assert.Equals(answer.Length, result.Length, "The answer differs by " + (answer.Length - result.Length).ToString());
        }