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.
41 lines
1.4 KiB
41 lines
1.4 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System.Threading.Tasks;
|
|
using Squidex.ClientLibrary;
|
|
using Squidex.ClientLibrary.Management;
|
|
using TestSuite.Model;
|
|
|
|
namespace TestSuite.Fixtures
|
|
{
|
|
public sealed class ContentReferencesFixture : CreatedAppFixture
|
|
{
|
|
public string SchemaName { get; } = "references";
|
|
|
|
public IContentsClient<TestEntityWithReferences, TestEntityWithReferencesData> Contents { get; }
|
|
|
|
public ContentReferencesFixture()
|
|
{
|
|
Task.Run(async () =>
|
|
{
|
|
try
|
|
{
|
|
await TestEntityWithReferences.CreateSchemaAsync(Schemas, AppName, SchemaName);
|
|
}
|
|
catch (SquidexManagementException ex)
|
|
{
|
|
if (ex.StatusCode != 400)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
}).Wait();
|
|
|
|
Contents = ClientManager.CreateContentsClient<TestEntityWithReferences, TestEntityWithReferencesData>(SchemaName);
|
|
}
|
|
}
|
|
}
|
|
|