/Rhino.Etl.Tests/Errors/ThrowingOperation.cs
http://github.com/ayende/rhino-etl · C# · 29 lines · 26 code · 3 blank · 0 comment · 1 complexity · 4945d5b14f03979a2092ed07f4949138 MD5 · raw file
- namespace Rhino.Etl.Tests.Errors
- {
- using System;
- using System.Collections.Generic;
- using System.IO;
- using Core;
- using Core.Operations;
- public class ThrowingOperation : AbstractOperation
- {
- private readonly int rowsAfterWhichToThrow = new Random().Next(1, 6);
- public int RowsAfterWhichToThrow
- {
- get { return rowsAfterWhichToThrow; }
- }
- public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
- {
- for (int i = 0; i < RowsAfterWhichToThrow; i++)
- {
- Row row = new Row();
- row["id"] = i;
- yield return row;
- }
- throw new InvalidDataException("problem");
- }
- }
- }