/Rhino.Etl.Tests/LoadTest/GenerateUsers.cs

http://github.com/ayende/rhino-etl · C# · 33 lines · 25 code · 3 blank · 5 comment · 1 complexity · 31952f9afbfd5d2ee12232f0ca170ec4 MD5 · raw file

  1. namespace Rhino.Etl.Tests.LoadTest
  2. {
  3. using System.Collections.Generic;
  4. using Core;
  5. using Rhino.Etl.Core.Operations;
  6. public class GenerateUsers : AbstractOperation
  7. {
  8. public GenerateUsers(int expectedCount)
  9. {
  10. this.expectedCount = expectedCount;
  11. }
  12. private int expectedCount;
  13. /// <summary>
  14. /// Executes this operation
  15. /// </summary>
  16. /// <param name="rows">The rows.</param>
  17. /// <returns></returns>
  18. public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
  19. {
  20. for (int i = 0; i < expectedCount; i++)
  21. {
  22. Row row = new Row();
  23. row["id"] = i;
  24. row["name"] = "ayende #" + i;
  25. row["email"] = "ayende" + i + "@example.org";
  26. yield return row;
  27. }
  28. }
  29. }
  30. }