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)); }
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); }
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); }