Beispiel #1
0
        public void Should_add_leading_slash_to_route_if_missing()
        {
            // Given
            var moduleWithBasePath = new FakeNancyModuleWithBasePath();

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

            // Then
            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/fake/test");
        }
Beispiel #2
0
        public void Should_store_route_combine_with_base_path_if_one_specified()
        {
            // Given
            var moduleWithBasePath = new FakeNancyModuleWithBasePath();

            // When
            moduleWithBasePath.Get("/NewRoute", args => Task.FromResult<object>(null));

            // Then
            moduleWithBasePath.Routes.Last().Description.Path.ShouldEqual("/fake/NewRoute");
        }