示例#1
0
        public void Should_store_single_route_when_calling_non_overridden_post_from_sub_module()
        {
            var moduleWithBasePath = new CustomNancyModule();

            moduleWithBasePath.Post["/Test1"] = d => null;

            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/Test1");
        }
示例#2
0
        public void Should_store_two_routes_when_registering_single_get_method()
        {
            var moduleWithBasePath = new CustomNancyModule();

            moduleWithBasePath.Get["/Test1", "/Test2"] = d => null;

            moduleWithBasePath.Routes.First().Description.Path.ShouldEqual("/Test1");
            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/Test2");
        }
示例#3
0
        public void Should_store_single_route_when_calling_non_overridden_post_from_sub_module()
        {
            // Given
            var moduleWithBasePath = new CustomNancyModule();

            // When
            moduleWithBasePath.Post <object>("/Test1", (_, __) => null);

            // Then
            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/Test1");
        }
        public void Should_store_single_route_when_calling_non_overridden_post_from_sub_module()
        {
            // Given
            var moduleWithBasePath = new CustomNancyModule();

            // When
            moduleWithBasePath.Post["/Test1"] = d => null;

            // Then
            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/Test1");
        }
        public void Should_store_two_routes_when_registering_single_get_method()
        {
            // Given
            var moduleWithBasePath = new CustomNancyModule();

            // When
            moduleWithBasePath.Get["/Test1", "/Test2"] = d => null;

            // Then
            moduleWithBasePath.Routes.First().Description.Path.ShouldEqual("/Test1");
            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/Test2");
        }