public void CommandTest() { BaseTest(); string routeKey = CommandRoute.GetKeyFromPath("/testcontroller/cmd1"); var commandRoute = _commandRouteDictionary[routeKey]; Assert.NotNull(commandRoute); }
public static CommandRoute GetCommandRoute(IChromelyContainer container, string commandPath) { var key = CommandRoute.GetKeyFromPath(commandPath); object commandObj = container.GetInstance(typeof(CommandRoute), key); if ((commandObj == null) || !(commandObj is CommandRoute)) { throw new Exception($"No route found for command with key:{key}."); } return (CommandRoute)commandObj; }
public static CommandRoute GetCommandRoute(IChromelyContainer container, string commandPath) { var key = CommandRoute.GetKeyFromPath(commandPath); var command = container.GetInstance(typeof(CommandRoute), key) as CommandRoute; if (command == null) { throw new Exception($"No route found for command with key:{key}."); } return(command); }