public void ProcessBatch_NotInitialised_ThrowsException() { ICifProcessor sut = new CifParser(_inputStreamFactory, _recordDefFactory); Assert.Throws <InvalidOperationException>(() => { sut.ProcessBatch(default(List <List <string> >), 0, ScheduleType.All, null); }); }
public void ReadCifMethod() { var records = new CifParser(new MemoryStream(Resource._1100110)); foreach (var record in records) { record.Should().BeOfType <FileParser.Record>(); record.Data.Should().NotBeNull(); } records.Count().Should().Be(1); }
public void ProcessBatch_EOFReached_ReturnsLastBatch() { ICifProcessor sut = new CifParser(_inputStreamFactory, _recordDefFactory); sut.Initialize(new MemoryStream()); List <List <string> > buffer = new List <List <string> >(); int result = sut.ProcessBatch(buffer, 999, ScheduleType.All, null); Assert.Equal(0, result); Assert.Equal(0, buffer.Count); }