Пример #1
0
        public void Delete_async_with_token_should_add_route()
        {
            // given
            var module = new ArgolisModuleTestable(this.templateProvider);

            // when
            module.Delete <object>((_, c) => null);

            // then
            module.Routes.Single().Description.Method.Should().Be("DELETE");
        }
Пример #2
0
        public void Delete_route_should_add_correct_route_entry()
        {
            // given
            var module = new ArgolisModuleTestable(this.templateProvider);

            // when
            module.Delete <object>(_ => new object(), context => true, "TestRoute");
            module.Delete <object>((_, c) => Task.FromResult(new object()), context => true, "TestRoute");
            module.Delete <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);
            }
        }
Пример #3
0
        public void Delete_async_should_add_route()
        {
            // given
            var module = new ArgolisModuleTestable(this.templateProvider);

            // when
            module.Delete <object>(_ => Task.FromResult(new object()));

            // then
            module.Routes.Single().Description.Method.Should().Be("DELETE");
        }