Ejemplo n.º 1
0
        private void ExecuteRunnerAction(RunnerAction runnerAction)
        {
            Console.WriteLine("Chosen action is: " + runnerAction.LongName);

            var client = TdlClient.Build()
                         .SetHostname(hostname)
                         .SetUniqueId(username)
                         .SetAuditStream(new ConsoleAuditStream())
                         .Create();

            var processingRules = new ProcessingRules();

            processingRules
            .On("display_description")
            .Call(p => RoundManagement.SaveDescription(p[0], p[1]))
            .Then(ClientActions.Publish);

            foreach (var solution in solutions)
            {
                processingRules
                .On(solution.Key)
                .Call(solution.Value)
                .Then(runnerAction.ClientAction);
            }

            client.GoLiveWith(processingRules);

            RecordingSystem.NotifyEvent(RoundManagement.GetLastFetchedRound(), runnerAction.ShortName);
        }
Ejemplo n.º 2
0
 public void GivenTheBrokerIsNotAvailable()
 {
     auditStream.ClearLog();
     client = TdlClient.Build()
              .SetHostname(Hostname + "1")
              .SetPort(Port)
              .SetUniqueId("X")
              .SetAuditStream(auditStream)
              .Create();
 }
Ejemplo n.º 3
0
        public void GivenIStartWithACleanBroker(string username)
        {
            requestQueue = broker.AddQueue($"{username}.req");
            requestQueue.Purge();

            responseQueue = broker.AddQueue($"{username}.resp");
            responseQueue.Purge();

            auditStream.ClearLog();
            client = TdlClient.Build()
                     .SetHostname(Hostname)
                     .SetPort(Port)
                     .SetUniqueId(username)
                     .SetAuditStream(auditStream)
                     .Create();
        }
Ejemplo n.º 4
0
        public void Start(string[] args)
        {
            if (!IsRecordingSystemOk())
            {
                Console.WriteLine("Please run `record_screen_and_upload` before continuing.");
                return;
            }

            var runnerAction = ExtractActionFrom(args).OrElse(defaultRunnerAction);

            Console.WriteLine("Chosen action is: " + runnerAction.LongName);

            var client = TdlClient.Build()
                         .SetHostname(hostname)
                         .SetUniqueId(username)
                         .SetAuditStream(new ConsoleAuditStream())
                         .Create();

            var processingRules = new ProcessingRules();

            processingRules
            .On("display_description")
            .Call(p => RoundManagement.DisplayAndSaveDescription(p[0], p[1]))
            .Then(ClientActions.Publish);

            foreach (var solution in solutions)
            {
                processingRules
                .On(solution.Key)
                .Call(solution.Value)
                .Then(runnerAction.ClientAction);
            }

            client.GoLiveWith(processingRules);

            RecordingSystem.NotifyEvent(RoundManagement.GetLastFetchedRound(), runnerAction.ShortName);
        }