Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Client"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <param name="updateReceiver">The update receiver.</param>
 /// <param name="connectionProvider">The connection provider.</param>
 /// <param name="versionProvider">The version provider.</param>
 /// <param name="parametersReader">The file reader.</param>
 /// <param name="packager">The packager.</param>
 /// <param name="resultsProcessor">The results processor.</param>
 /// <param name="serializer">The serializer.</param>
 /// <param name="log">The log.</param>
 public Client(ClientParameters options,
               IUpdateReceiver updateReceiver,
               IConnectionProvider connectionProvider,
               IVersionProvider versionProvider,
               ITestRunParametersFileReader parametersReader,
               IProjectPackager packager,
               TestResultsProcessor resultsProcessor,
               ITestResultsSerializer serializer,
               ILog log)
 {
     this.options = options;
     this.updateReceiver = updateReceiver;
     this.connectionProvider = connectionProvider;
     this.versionProvider = versionProvider;
     this.parametersReader = parametersReader;
     this.packager = packager;
     this.resultsProcessor = resultsProcessor;
     this.serializer = serializer;
     this.log = log;
 }
        /// <summary>
        /// Parses the command line returning a typed 
        /// options object
        /// </summary>
        /// <param name="arguments"></param>
        /// <returns></returns>
        public static ClientParameters Parse(IEnumerable<string> arguments)
        {
            var result = new ClientParameters();
            var set = new ConsoleParametersParser
                {
                    {"xml", (string xmlFileName) => result.NUnitParameters.XmlFileName = xmlFileName, false },
                    {"noshadow", (bool noShadow) => result.NUnitParameters.NoShadow = noShadow, true },
                    {"configuration", (string configuration) => result.NUnitParameters.Configuration = configuration, false },
                    {"server", (string testServerUri) => result.ServerUri = Uri.IsWellFormedUriString(testServerUri, UriKind.Absolute)
                        ? new Uri(testServerUri)
                        : null, false},
                    {"include", (string includes) => result.NUnitParameters.IncludeCategories = includes },
                    {"exclude", (string excludes) => result.NUnitParameters.ExcludeCategories = excludes },
                    {"alias", (string alias) => result.Alias = alias },
                    {"run", (string run) => result.NUnitParameters.TestToRun = run},
                    {ConsoleOption.UnnamedOptionName, (string assembly) => result.NUnitParameters.AssembliesToTest.Add(assembly), false},
                };

            result.UnknownOptions.AddRange(set.Parse(arguments));
            return result;
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientProgram"/> class.
 /// </summary>
 /// <param name="options">Options, which were provided through command line</param>
 /// <param name="bootstrapperParameters">The bootstrapper parameters.</param>
 /// <param name="client">The client.</param>
 /// <param name="resolver">The resolver.</param>
 /// <param name="catcher">The catcher.</param>
 /// <param name="log">The log.</param>
 public ClientProgram(ClientParameters options, BootstrapperParameters bootstrapperParameters, Client client, AssemblyResolver resolver, ExceptionCatcher catcher, ILog log)
     : base(null, catcher, log, bootstrapperParameters)
 {
     this.options = options;
     this.client = client;
 }