Example #1
0
        public void Initialize_StreamNull_ThrowsException()
        {
            ICifProcessor sut = new CifEditor(_inputStreamFactory,
                                              _recordDefFactory, _scheduleMatcher);

            Assert.Throws <ArgumentNullException>(() => { sut.Initialize(null); });
        }
Example #2
0
        public void ProcessBatch_NotInitialised_ThrowsException()
        {
            ICifProcessor sut = new CifEditor(_inputStreamFactory,
                                              _recordDefFactory, _scheduleMatcher);

            Assert.Throws <InvalidOperationException>(() =>
            {
                sut.ProcessBatch(default(List <List <string> >), 0, ScheduleType.All, null);
            });
        }
Example #3
0
        public void ProcessBatch_EOFReached_ReturnsLastBatch()
        {
            ICifProcessor sut = new CifEditor(_inputStreamFactory,
                                              _recordDefFactory, _scheduleMatcher);

            sut.Initialize(new MemoryStream());
            List <List <string> > buffer = new List <List <string> >();

            int result = sut.ProcessBatch(buffer, 999, ScheduleType.All,
                                          new BatchArgs(new List <ScheduleCriteria>()));

            Assert.Equal(0, result);
            Assert.Equal(0, buffer.Count);
        }