From 01be59b347f8b1400f87a06ba517995fb6dcb622 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Sun, 3 Nov 2013 20:18:57 +0100 Subject: [PATCH] add FillAccount method for stress tests --- PocketSharp.Tests/StressTests.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/PocketSharp.Tests/StressTests.cs b/PocketSharp.Tests/StressTests.cs index 7f89947..551dd7e 100644 --- a/PocketSharp.Tests/StressTests.cs +++ b/PocketSharp.Tests/StressTests.cs @@ -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); + } + } } } \ No newline at end of file