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); }); }
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); }); }
public void FluentControllerBuilder_ThrowsOnFluentActionWithoutHandler() { var fluentAction = new FluentAction("/route/url", HttpMethod.Get); Assert.Throws <FluentActionValidationException>(() => BuilderTestUtils.BuildAction(fluentAction)); }