Exemplo n.º 1
0
        public List <ConsoleFlowResult> Run()
        {
            if (!registeredMethodsInAgent.Any())
            {
                ConsoleWriter.WriteLine("Couldn't find any registered methods in the agent, which can be invoked", Color.Yellow);
                return(null);
            }

            var consoleFlow = new ConsoleWizard
            {
                IsStepCountVisible = true
            };

            var agentSelectionPage = new ConsoleOptionsPage("Which method you want the message to be sent to ?", ConsoleColor.Cyan);

            registeredMethodsInAgent.ForEach(method => { agentSelectionPage.AddOption(method); });

            var basicConfigurationPage = new ConsoleReadItemsPage(new List <ConsoleReadItem> {
                new ConsoleReadItem {
                    Question = "Time in milliseconds between sends? :", ItemType = typeof(int), ValidationErrorMessage = "Please enter a numeric value"
                },
                new ConsoleReadItem {
                    Question = "Timeout in milliseconds? :", ItemType = typeof(int), ValidationErrorMessage = "Please enter a numeric value"
                }
            }, ConsoleColor.Cyan);

            consoleFlow.AddPage(agentSelectionPage);
            consoleFlow.AddPage(basicConfigurationPage);

            return(consoleFlow.Run());
        }
Exemplo n.º 2
0
        public List <ConsoleFlowResult> Run()
        {
            var consoleFlow = new ConsoleWizard
            {
                IsStepCountVisible = true
            };

            var basicConfigurationPage = new ConsoleReadItemsPage(new List <ConsoleReadItem> {
                new ConsoleReadItem {
                    Question = "What is the target URL of Hub? :", Validator = TargetUrlValidator, ValidationErrorMessage = "Please enter a valid url"
                },
                new ConsoleReadItem {
                    Question = "what is the name of Hub? :"
                },
                new ConsoleReadItem {
                    Question = "How many connections you want to ramp up? :", ItemType = typeof(int), ValidationErrorMessage = "Please enter a numeric value"
                }
            }, ConsoleColor.Cyan);

            var agentSelectionPage = new ConsoleOptionsPage("Which of the below Agents should run the test?", ConsoleColor.Cyan);
            var agentList          = AgentBuilder.GetAgentList();

            agentList.ForEach(agent => agentSelectionPage.AddOption(agent));
            agentSelectionPage.AddExitOption();

            var transportSelectionPage = new ConsoleOptionsPage("Choose the transport mechanism?", ConsoleColor.Cyan);

            transportSelectionPage.AddOption("Websockets");
            transportSelectionPage.AddOption("Long Polling");
            transportSelectionPage.AddOption("Server Sent Events");
            transportSelectionPage.AddOption("Auto");

            var clientTypeSelectionPage = new ConsoleOptionsPage("Choose the client type?", ConsoleColor.Cyan);

            clientTypeSelectionPage.AddOption("SignalR");
            clientTypeSelectionPage.AddOption("SignalR Core");

            consoleFlow.AddPage(basicConfigurationPage);
            consoleFlow.AddPage(agentSelectionPage);
            consoleFlow.AddPage(transportSelectionPage);
            consoleFlow.AddPage(clientTypeSelectionPage);

            return(consoleFlow.Run());
        }