public async Task AssetImport_Execute_EndToEnd()
        {
            var name1 = $"{GetRandomSchemaName.Substring(0, 10)}.jpg";

            await AttachmentClient.AssertNoAttachmentsExist("aut", delay : TimeSpan.FromSeconds(0.5));

            await AssetStories.ImportAsset(AttachmentImportSystemUnderTest, "aut", name1, AssetLoader.AsPath(AssetLoader.App1Asset2Name));

            var item1 = await AttachmentClient.GetAssetByNameOrDefault("aut", name1);

            item1.Should().NotBeNull();
            item1.IsImage.Should().BeTrue();

            await AttachmentClient.DeleteAsset("aut", item1.Id);

            await AttachmentClient.AssertNoAttachmentsExist("aut", delay : TimeSpan.FromSeconds(0.5));
        }
        public async Task AssetUpdate_Execute_EndToEnd()
        {
            var name1 = $"{GetRandomSchemaName.Substring(0, 10)}.jpg";

            await AttachmentClient.AssertNoAttachmentsExist("aut", delay : TimeSpan.FromSeconds(0.5));

            var posted1 = await AttachmentClient.CreateAsset("aut", name1, MimeTypeMap.GetMimeType("jpg"), AssetLoader.AsStream(AssetLoader.App1Asset2Name));

            await AssetStories.UpdateAsset(AssetUpdateContentSystemUnderTest, "aut", posted1.Id, AssetLoader.AsPath(AssetLoader.App1Asset3Name));

            var updated1 = await AttachmentClient.GetAssetByNameOrDefault("aut", name1);

            updated1.Should().NotBeNull();
            updated1.Id.Should().Be(posted1.Id);
            updated1.Tags.Should().Contain(posted1.Tags);
            updated1.FileName.Should().BeEquivalentTo(posted1.FileName);
            updated1.FileSize.Should().NotBe(posted1.FileSize);

            await AttachmentClient.DeleteAsset("aut", posted1.Id);

            await AttachmentClient.AssertNoAttachmentsExist("aut", delay : TimeSpan.FromSeconds(0.5));
        }
Ejemplo n.º 3
0
        public async Task ContentPost_Execute_EndToEnd()
        {
            var name1 = GetRandomSchemaName;
            await SchemaClient.CreateSchema("aut", AssetLoader.Schema1(name1));

            await SchemaClient.PublishSchema("aut", name1);

            var expectedFirst  = AssetLoader.AsDynamic(AssetLoader.Schema1DataQueryResponseName).Items[0];
            var expectedSecond = AssetLoader.AsDynamic(AssetLoader.Schema1DataQueryResponseName).Items[1];

            // act

            await ContentStories.PostContent(ContentPostSystemUnderTest, "aut", name1, AssetLoader.AsPath(AssetLoader.Schema1Data1PostName), publish : true);

            await ContentStories.PostContent(ContentPostSystemUnderTest, "aut", name1, AssetLoader.AsPath(AssetLoader.Schema1Data2PostName), publish : true);

            var content = await ContentClient.QueryContent("aut", name1, new QueryRequest()
            {
                Skip = 0,
                Top  = 100
            });

            int contentTotal = Convert.ToInt32(content.Total);

            contentTotal.Should().Be(2);
            var actualFirst  = content.Items[0];
            var actualSecond = content.Items[1];

            // todo : verify export content

            await SchemaClient.DeleteSchema("aut", name1);

            await SchemaClient.AssertNoSchemasExist("aut", delay : TimeSpan.FromSeconds(0.5));
        }
Ejemplo n.º 4
0
        public async Task ContentImport_Execute_EndToEnd()
        {
            var name1 = GetRandomSchemaName;
            await SchemaClient.CreateSchema("aut", AssetLoader.Schema1(name1));

            await SchemaClient.PublishSchema("aut", name1);

            var expected1 = AssetLoader.AsDynamic(AssetLoader.Schema1DataQueryResponseName).Items[0];
            var expected2 = AssetLoader.AsDynamic(AssetLoader.Schema1DataQueryResponseName).Items[1];

            await ContentStories.ImportContent(ContentImportSystemUnderTest, "aut", name1, AssetLoader.AsPath(AssetLoader.Schema1DataImportName), publish : true);

            var actuals = await ContentClient.QueryContent("aut", name1, new QueryRequest()
            {
                Skip = 0,
                Top  = 100
            });

            var actualsTotal = actuals.Total;

            actualsTotal.Should().Be(2);

            var actual1 = actuals.Items[0];
            var actual2 = actuals.Items[1];

            // todo : verify

            await SchemaClient.DeleteSchema("aut", name1);

            await SchemaClient.AssertNoSchemasExist("aut", delay : TimeSpan.FromSeconds(0.5));
        }
        public async Task SchemaImport_Execute_EndToEnd()
        {
            var name1 = GetRandomSchemaName;

            await SchemaClient.AssertNoSchemasExist("aut", delay : TimeSpan.FromSeconds(0.5));

            await SchemaStories.ImportSchema(SchemaImportSystemUnderTest, "aut", name1, AssetLoader.AsPath(AssetLoader.Schema1Name));

            await SchemaClient.AssertSchemaMustExist("aut", name1, delay : TimeSpan.FromSeconds(0.5));

            await SchemaClient.DeleteSchema("aut", name1);

            await SchemaClient.AssertNoSchemasExist("aut", delay : TimeSpan.FromSeconds(0.5));
        }