private ChallengeSessionConfig(string journeyId)
 {
     Port       = 8222;
     UseColours = true;
     RecordingSystemShouldBeOn = true;
     AuditStream = new ConsoleAuditStream();
     JourneyId   = journeyId;
 }
Exemple #2
0
        public TdlClient(
            string hostname,
            int port,
            string uniqueId,
            long timeToWaitForRequests,
            IAuditStream auditStream)
        {
            this.hostname = hostname;
            this.port     = port;
            this.uniqueId = uniqueId;
            audit         = new Audit(auditStream);

            TimeToWaitForRequests = timeToWaitForRequests;
        }
        public static string SaveDescription(string label, string description, IAuditStream auditStream)
        {
            if (!Directory.Exists(ChallengesPath))
            {
                Directory.CreateDirectory(ChallengesPath);
            }

            // Save description.
            var descriptionPath = Path.Combine(ChallengesPath, $"{label}.txt");

            WriteAllTextWithFlush(descriptionPath, description.Replace("\n", Environment.NewLine));
            var relativePath = descriptionPath.Replace(PathHelper.RepositoryPath + Path.DirectorySeparatorChar, "");

            auditStream.WriteLine($"Challenge description saved to file: {relativePath}.");

            // Save round label.
            WriteAllTextWithFlush(LastFetchedRoundPath, label);

            return("OK");
        }
 public Audit(IAuditStream auditStream)
 {
     this.auditStream = auditStream;
     lineBuilder      = new StringBuilder();
 }
        public static void SaveDescription(IRoundChangesListener listener, string rawDescription, IAuditStream auditStream)
        {
            // DEBT - the first line of the response is the ID for the round, the rest of the responseMessage is the description
            var newlineIndex = rawDescription.IndexOf('\n');

            if (newlineIndex <= 0)
            {
                return;
            }

            var roundId          = rawDescription.Substring(0, newlineIndex);
            var lastFetchedRound = GetLastFetchedRound();

            if (!roundId.Equals(lastFetchedRound))
            {
                listener.OnNewRound(roundId);
            }
            SaveDescription(roundId, rawDescription, auditStream);
        }
Exemple #6
0
 public NoisyImplementationRunner(string deployMessage, IAuditStream auditStream)
 {
     this.deployMessage = deployMessage;
     this.auditStream   = auditStream;
 }
 public Builder SetAuditStream(IAuditStream auditStream)
 {
     this.auditStream = auditStream;
     return(this);
 }
Exemple #8
0
 public ImplementationRunnerConfig SetAuditStream(IAuditStream auditStream)
 {
     AuditStream = auditStream;
     return(this);
 }
Exemple #9
0
 public ImplementationRunnerConfig()
 {
     Port = 61616;
     RequestTimeoutMilliseconds = 500;
     AuditStream = new ConsoleAuditStream();
 }
Exemple #10
0
 public LogAuditStream(IAuditStream originalStream)
 {
     this.originalStream = originalStream;
 }
 public ChallengeSessionConfig WithAuditStream(IAuditStream auditStream)
 {
     AuditStream = auditStream;
     return(this);
 }