public void ProcessThenWriteReader() { MARCWriter proctests = new MARCWriter(@"proctestforreader.dat"); MARCReader procrecords = new MARCReader(@"C:\Documents and Settings\wkurt\My Documents\Visual Studio 2008\Projects\TestMARC\TestMARC\marc.dat"); proctests.ProcessThenWrite(new MARCWriter.MARCProcess(testProc), procrecords); proctests.Close(); MARCReader test = new MARCReader(@"proctestforreader.dat"); foreach (MARCRecord record in test) { string testValue = record.GetField(999)[0].FormatField(); Assert.Equals("hello there!", testValue); } test.Close(); }
public void ProcessThenWriteSingeRecord() { MARCWriter proctest = new MARCWriter(@"proctest.dat"); MARCRecord procrecord = new MARCRecord(); proctest.ProcessThenWrite(new MARCWriter.MARCProcess(testProc), procrecord); proctest.Close(); MARCReader test = new MARCReader(@"proctest.dat"); foreach (MARCRecord record in test) { string testValue = record.GetField(999)[0].FormatField(); Assert.Equals("hello there!", testValue); } test.Close(); }
public void ProcessThenWriteMultipeRecords() { MARCWriter proctests = new MARCWriter(@"proctests.dat"); MARCRecord[] procrecords = new MARCRecord[4] { new MARCRecord(), new MARCRecord(), new MARCRecord(), new MARCRecord() }; proctests.ProcessThenWrite(new MARCWriter.MARCProcess(testProc), procrecords); proctests.Close(); MARCReader test = new MARCReader(@"proctests.dat"); foreach (MARCRecord record in test) { string testValue = record.GetField(999)[0].FormatField(); Assert.Equals("hello there!", testValue); } test.Close(); }