コード例 #1
0
        public async Task Should_not_rewrite_other_urls()
        {
            var middleware = new IndexUrlRewriterMiddleware(new DummyNext());
            var context    = new OwinContext
            {
                Request =
                {
                    Path   = new PathString("/something"),
                    Method = "GET"
                }
            };
            await middleware.Invoke(context);

            Assert.AreEqual("/something", context.Request.Path.Value);
        }
コード例 #2
0
        public async Task Should_rewrite_slash_url()
        {
            var middleware = new IndexUrlRewriterMiddleware(new DummyNext());
            var context    = new OwinContext
            {
                Request =
                {
                    Path   = new PathString("/"),
                    Method = "GET"
                }
            };
            await middleware.Invoke(context);

            Assert.AreEqual(("/index.html"), context.Request.Path.Value);
        }