Esempio n. 1
0
        public void GetCommandName_Throws_Exception()
        {
            var middleware = new CommandRMiddleware(null);
            var context    = new DefaultHttpContext();

            context.Request.Path = new PathString("/_commandr");

            Assert.Throws <ArgumentException>(() => middleware.GetCommandName(context));
        }
Esempio n. 2
0
        public void IsCommandRRequest_Returns_True()
        {
            var middleware = new CommandRMiddleware(null);
            var context    = new DefaultHttpContext();

            context.Request.Path = new PathString("/_commandr/bob");

            var result = middleware.IsCommandRRequest(context, "_commandr");

            Assert.True(result);
        }
Esempio n. 3
0
        public void GetCommandName_Returns_Success(string path)
        {
            var middleware = new CommandRMiddleware(null);
            var context    = new DefaultHttpContext();

            context.Request.Path = new PathString(path);

            var result = middleware.GetCommandName(context);

            Assert.Equal("my.command", result);
        }