Exemplo n.º 1
0
        public async Task Create_should_throw_exception_if_data_is_not_valid()
        {
            var context = CreateContextForCommand(new CreateContent {
                ContentId = contentId, Data = new NamedContentData()
            });

            await TestCreate(content, async _ =>
            {
                await Assert.ThrowsAsync <ValidationException>(() => sut.HandleAsync(context));
            }, false);
        }
Exemplo n.º 2
0
        public async Task Create_should_throw_exception_if_data_is_not_valid()
        {
            A.CallTo(() => scriptEngine.ExecuteAndTransform(A <ScriptContext> .Ignored, A <string> .Ignored))
            .Returns(invalidData);

            var context = CreateContextForCommand(new CreateContent {
                ContentId = contentId, Data = invalidData, User = user
            });

            await TestCreate(content, async _ =>
            {
                await Assert.ThrowsAsync <ValidationException>(() => sut.HandleAsync(context));
            }, false);
        }