public void FluentControllerBuilder_FluentActionWithDoAndNoReturnThrows()
 {
     Assert.Throws <FluentActionValidationException>(() =>
                                                     BuilderTestUtils.BuildAction(
                                                         new FluentAction("/route/url", HttpMethod.Get)
                                                         .Do(() => Console.WriteLine("foo"))));
 }
 public void FluentControllerBuilder_FluentActionOrderTestDoThrows()
 {
     Assert.Throws <FluentActionValidationException>(() => {
         BuilderTestUtils.BuildAction(
             new FluentAction("/route/url", HttpMethod.Get)
             .Do(() => { /* woop woop */ }),
             TestLogger);
     });
 }
 public void FluentControllerBuilder_FluentActionOrderTestDoAThrows()
 {
     Assert.Throws <FluentActionValidationException>(() => {
         BuilderTestUtils.BuildAction(
             new FluentAction("/route/url", HttpMethod.Get)
             .DoAsync(async() => { await Task.Delay(1); }),
             TestLogger);
     });
 }
Ejemplo n.º 4
0
 public void FluentControllerBuilder_FluentActionOrderTestToADoThrows()
 {
     Assert.Throws <FluentActionValidationException>(() =>
     {
         BuilderTestUtils.BuildAction(
             new FluentAction("/route/url", HttpMethod.Get)
             .To(async() => { await Task.Delay(1); return("Unused"); })
             .Do(() => { /* woop woop */ }),
             TestLogger);
     });
 }
Ejemplo n.º 5
0
        public void FluentControllerBuilder_ThrowsOnFluentActionWithoutHandler()
        {
            var fluentAction = new FluentAction("/route/url", HttpMethod.Get);

            Assert.Throws <FluentActionValidationException>(() => BuilderTestUtils.BuildAction(fluentAction));
        }