public void Put_async_should_add_route() { // given var module = new ArgolisModuleTestable(this.templateProvider); // when module.Put <object>(_ => Task.FromResult(new object())); // then module.Routes.Single().Description.Method.Should().Be("PUT"); }
public void Get_async_with_token_should_add_route() { // given var module = new ArgolisModuleTestable(this.templateProvider); // when module.Get <object>((_, c) => null); // then module.Routes.Single().Description.Method.Should().Be("GET"); }
public void Head_sync_should_add_route() { // given var module = new ArgolisModuleTestable(this.templateProvider); // when module.Head <object>(_ => new object()); // then module.Routes.Single().Description.Method.Should().Be("HEAD"); }
public void Get_route_should_add_correct_route_entry() { // given var module = new ArgolisModuleTestable(this.templateProvider); // when module.Get <object>(_ => new object(), context => true, "TestRoute"); module.Get <object>((_, c) => Task.FromResult(new object()), context => true, "TestRoute"); module.Get <object>(_ => Task.FromResult(new object()), context => true, "TestRoute"); // then foreach (var route in module.Routes) { var description = route.Description; description.Condition.Should().NotBeNull(); description.Name.Should().Be("TestRoute"); description.Path.Should().Be(TestTemplate); } }