コード例 #1
0
        public void Parse_InvalidArg()
        {
            var args = new List <string>(_args);

            args[3] = "--not-an-arg=invalid";
            Assert.Null(AgentOptions.Parse(args.ToArray()));
        }
コード例 #2
0
        public void Parse_Missing_Debugger_File()
        {
            var args = new List <string>(_args);

            args[3] = "--debugger=invalid";
            Assert.Null(AgentOptions.Parse(args.ToArray()));
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }