add FillAccount method for stress tests

This commit is contained in:
2013-11-03 20:18:57 +01:00
parent 396cf69a40
commit 01be59b347
+19
View File
@@ -25,6 +25,8 @@ namespace PocketSharp.Tests
);
urls = File.ReadAllLines("../../url-10000.csv").Select(item => item.Split(',')[1]);
//await FillAccount(598, 10000);
}
@@ -57,5 +59,22 @@ namespace PocketSharp.Tests
{
}
private async Task FillAccount(int offset, int count)
{
int r;
int r2;
string[] tag;
Random rnd = new Random();
foreach (string url in urls.Skip(offset).Take(count))
{
r = rnd.Next(tags.Length);
r2 = rnd.Next(tags.Length);
tag = new string[] { tags[r], tags[r2] };
await client.Add(new Uri("http://" + url), tag);
}
}
}
}