コード例 #1
0
        public async Task Should_enrich_content_with_status_color()
        {
            var content = CreateContent();

            A.CallTo(() => contentWorkflow.GetInfoAsync(content))
            .Returns(new StatusInfo(Status.Published, StatusColors.Published));

            await sut.EnrichAsync(requestContext, new[] { content }, schemaProvider);

            Assert.Equal(StatusColors.Published, content.StatusColor);
        }
コード例 #2
0
        public async Task Should_enrich_content_with_next_statuses()
        {
            var content = new ContentEntity {
                SchemaId = schemaId
            };

            var nexts = new[]
            {
                new StatusInfo(Status.Published, StatusColors.Published)
            };

            A.CallTo(() => workflow.GetNextAsync(content, content.Status, requestContext.User))
            .Returns(nexts);

            await sut.EnrichAsync(requestContext, new[] { content }, null !);

            Assert.Equal(nexts, content.NextStatuses);
        }
コード例 #3
0
        public async Task Should_enrich_content_with_status_color()
        {
            var content = new ContentEntity {
                SchemaId = schemaId
            };

            A.CallTo(() => contentWorkflow.GetInfoAsync(content, content.Status))
            .Returns(new StatusInfo(Status.Published, StatusColors.Published));

            await sut.EnrichAsync(requestContext, new[] { content }, null !);

            Assert.Equal(StatusColors.Published, content.StatusColor);
        }