|
|
|
@ -47,6 +47,35 @@ namespace TestSuite.ApiTests |
|
|
|
Assert.Contains(schemas.Items, x => x.Name == schemaName); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Should_create_singleton_schema() |
|
|
|
{ |
|
|
|
var schemaName = $"schema-{Guid.NewGuid()}"; |
|
|
|
|
|
|
|
// STEP 1: Create schema
|
|
|
|
var createRequest = new CreateSchemaDto { Name = schemaName, IsSingleton = true }; |
|
|
|
|
|
|
|
var schema = await _.Schemas.PostSchemaAsync(_.AppName, createRequest); |
|
|
|
|
|
|
|
// Should return created schemas with correct name.
|
|
|
|
Assert.Equal(schemaName, schema.Name); |
|
|
|
|
|
|
|
|
|
|
|
// STEP 2: Get all schemas
|
|
|
|
var schemas = await _.Schemas.GetSchemasAsync(_.AppName); |
|
|
|
|
|
|
|
// Should provide new schema when apps are schemas.
|
|
|
|
Assert.Contains(schemas.Items, x => x.Name == schemaName); |
|
|
|
|
|
|
|
|
|
|
|
// STEP 3: Get singleton content
|
|
|
|
var client = _.ClientManager.CreateDynamicContentsClient(schemaName); |
|
|
|
|
|
|
|
var content = await client.GetAsync(schema.Id); |
|
|
|
|
|
|
|
Assert.NotNull(content); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Should_create_schema_with_checkboxes() |
|
|
|
{ |
|
|
|
|