PageRenderTime 519ms CodeModel.GetById 407ms app.highlight 2ms RepoModel.GetById 108ms app.codeStats 0ms

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