sliiim
This commit is contained in:
@@ -33,23 +33,23 @@ namespace PocketSharp.Tests
|
||||
Assert.True(item.Uri == itemDuplicate.Uri);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task IsItemJsonPopulated()
|
||||
{
|
||||
List<PocketItem> items = (await client.Get()).ToList();
|
||||
string schemaJson = @"{
|
||||
'description': 'PocketItem',
|
||||
'type': 'object'
|
||||
}";
|
||||
// [Fact]
|
||||
// public async Task IsItemJsonPopulated()
|
||||
// {
|
||||
// List<PocketItem> items = (await client.Get()).ToList();
|
||||
// string schemaJson = @"{
|
||||
// 'description': 'PocketItem',
|
||||
// 'type': 'object'
|
||||
// }";
|
||||
|
||||
JsonSchema schema = JsonSchema.Parse(schemaJson);
|
||||
foreach (var pocketItem in items)
|
||||
{
|
||||
Assert.True(!string.IsNullOrWhiteSpace(pocketItem.Json));
|
||||
var jObject = JObject.Parse(pocketItem.Json);
|
||||
Assert.True(jObject.IsValid(schema));
|
||||
}
|
||||
}
|
||||
// JsonSchema schema = JsonSchema.Parse(schemaJson);
|
||||
// foreach (var pocketItem in items)
|
||||
// {
|
||||
// Assert.True(!string.IsNullOrWhiteSpace(pocketItem.Json));
|
||||
// var jObject = JObject.Parse(pocketItem.Json);
|
||||
// Assert.True(jObject.IsValid(schema));
|
||||
// }
|
||||
// }
|
||||
|
||||
[Fact]
|
||||
public async Task AreFilteredItemsRetrieved()
|
||||
|
||||
@@ -105,13 +105,27 @@ namespace PocketSharp.Tests
|
||||
string[] tag;
|
||||
Random rnd = new Random();
|
||||
|
||||
foreach (string url in urls.Skip(offset).Take(count))
|
||||
var items = urls.Skip(offset).Take(count)
|
||||
.Select((value, idx) => new { Value = value, Index = idx })
|
||||
.GroupBy(item => item.Index / 100, item => item.Value)
|
||||
.Cast<IEnumerable<string>>();
|
||||
|
||||
foreach (IEnumerable<string> urlGroup in items)
|
||||
{
|
||||
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);
|
||||
await Task.WhenAll(urlGroup.Select(url =>
|
||||
{
|
||||
r = rnd.Next(tags.Length);
|
||||
r2 = rnd.Next(tags.Length);
|
||||
tag = new string[] { tags[r], tags[r2] };
|
||||
return client.Add(new Uri("http://" + url), tag);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Fillll()
|
||||
{
|
||||
await FillAccount(11000, 89999);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user