mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System.Threading.Tasks;
|
|
using TestSuite.Model;
|
|
|
|
namespace TestSuite.Fixtures
|
|
{
|
|
public class ContentQueryFixture : ContentFixture
|
|
{
|
|
public ContentQueryFixture()
|
|
: this("my-reads")
|
|
{
|
|
}
|
|
|
|
protected ContentQueryFixture(string schemaName = "my-schema")
|
|
: base(schemaName)
|
|
{
|
|
Task.Run(async () =>
|
|
{
|
|
Dispose();
|
|
|
|
for (var i = 10; i > 0; i--)
|
|
{
|
|
await Contents.CreateAsync(new TestEntityData { Number = i }, true);
|
|
}
|
|
}).Wait();
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
Task.Run(async () =>
|
|
{
|
|
var contents = await Contents.GetAsync();
|
|
|
|
foreach (var content in contents.Items)
|
|
{
|
|
await Contents.DeleteAsync(content);
|
|
}
|
|
}).Wait();
|
|
}
|
|
}
|
|
}
|
|
|