public void Parse_InvalidArg() { var args = new List <string>(_args); args[3] = "--not-an-arg=invalid"; Assert.Null(AgentOptions.Parse(args.ToArray())); }
public void Parse_Missing_Debugger_File() { var args = new List <string>(_args); args[3] = "--debugger=invalid"; Assert.Null(AgentOptions.Parse(args.ToArray())); }
public void Parse_Multiple_Applications() { var args = new List <string>(_args); args.Add("--application-id=12345"); Assert.Null(AgentOptions.Parse(args.ToArray())); Assert.Contains("Please supply either", _writer.ToString()); }
public void Parse_DisplayHelp_ErrorParsing() { var args = new List <string>(_args); args[3] = "--debugger=invalid"; Assert.Null(AgentOptions.Parse(args.ToArray())); Assert.Contains("Debugger file not found", _writer.ToString()); Assert.Contains(_helpText, _writer.ToString()); }
public void Parse() { var options = AgentOptions.Parse(_args); Assert.Equal(_module, options.Module); Assert.Equal(_version, options.Version); Assert.Equal(_debugger, options.Debugger); Assert.Equal(_application, options.ApplicationStartCommand); Assert.Equal(_projectId, options.ProjectId); Assert.Null(options.ApplicationId); Assert.Null(options.SourceContextFile); Assert.Null(options.SourceContext); Assert.False(options.PropertyEvaluation); Assert.False(options.MethodEvaluation); }
public void Parse_SourceContext() { var sourceContext = new SourceContext { Git = new GitSourceContext { Url = "some-url.com", RevisionId = "rev-id", } }; var filePath = Path.GetTempFileName(); File.WriteAllText(filePath, sourceContext.ToString()); var args = new List <string>(_args); args.Add($"--source-context={filePath}"); var options = AgentOptions.Parse(args.ToArray()); Assert.Equal(sourceContext, options.SourceContext); }