/Rhino.Etl.Tests/LoadTest/GenerateRandomIds.cs
http://github.com/ayende/rhino-etl · C# · 27 lines · 25 code · 2 blank · 0 comment · 1 complexity · 1febc7bc45e0f6ac77e3680c10178cf6 MD5 · raw file
- namespace Rhino.Etl.Tests.LoadTest
- {
- using System;
- using System.Collections.Generic;
- using Core;
- using Rhino.Etl.Core.Operations;
- public class GenerateRandomIds : AbstractOperation
- {
- public GenerateRandomIds(int expectedCount)
- {
- this.expectedCount = expectedCount;
- }
- private readonly int expectedCount;
- public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
- {
- for (int i = 0; i < expectedCount; i++)
- {
- Row row = new Row();
- row["old_id"] = i;
- row["new_id"] = Guid.NewGuid();
- yield return row;
- }
- }
- }
- }