예제 #1
0
        public JObject AsJson()
        {
            var options = new JObject {
                { Constants.FieldList, new JArray(FieldList) }
            };

            if (MergeMode != SyncState.MergeModeOptions.None)
            {
                options.Add(Constants.MergeMode, MergeMode.ToString());
            }
            return(options);
        }
예제 #2
0
        /// <summary>
        /// Retrieve the arguments
        /// </summary>
        /// <param name="result"></param>
        /// <returns></returns>
        protected override string GetProcessArguments(IIntegrationResult result)
        {
            ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
            var coverageFile = string.IsNullOrEmpty(CoverageFile) ? "coverage.xml" : CoverageFile;

            buffer.AppendArgument(RootPath(coverageFile, true));

            // Add all the NCover arguments
            buffer.AppendIf(ClearCoverageFilters, "//ccf");
            foreach (var filter in CoverageFilters ?? new CoverageFilter[0])
            {
                buffer.AppendArgument("//cf {0}", filter.ToParamString());
            }
            foreach (var threshold in MinimumThresholds ?? new CoverageThreshold[0])
            {
                buffer.AppendArgument("//mc {0}", threshold.ToParamString());
            }
            buffer.AppendIf(UseMinimumCoverage, "//mcsc");
            buffer.AppendIf(XmlReportFilter != NCoverReportFilter.Default, "//rdf {0}", XmlReportFilter.ToString());
            foreach (var threshold in SatisfactoryThresholds ?? new CoverageThreshold[0])
            {
                buffer.AppendArgument("//sct {0}", threshold.ToParamString());
            }
            buffer.AppendIf(NumberToReport > 0, "//smf {0}", NumberToReport.ToString(CultureInfo.CurrentCulture));
            buffer.AppendIf(!string.IsNullOrEmpty(TrendOutputFile), "//at \"{0}\"", RootPath(TrendOutputFile, false));
            buffer.AppendArgument("//bi \"{0}\"", string.IsNullOrEmpty(BuildId) ? result.Label : BuildId);
            buffer.AppendIf(!string.IsNullOrEmpty(HideElements), "//hi \"{0}\"", HideElements);
            buffer.AppendIf(!string.IsNullOrEmpty(TrendInputFile), "//lt \"{0}\"", RootPath(TrendInputFile, false));
            GenerateReportList(buffer);
            buffer.AppendIf(!string.IsNullOrEmpty(ProjectName), "//p \"{0}\"", ProjectName);
            buffer.AppendIf(SortBy != NCoverSortBy.None, "//so \"{0}\"", SortBy.ToString());
            buffer.AppendIf(TopUncoveredAmount > 0, "//tu \"{0}\"", TopUncoveredAmount.ToString(CultureInfo.CurrentCulture));
            buffer.AppendIf(MergeMode != NCoverMergeMode.Default, "//mfm \"{0}\"", MergeMode.ToString());
            buffer.AppendIf(!string.IsNullOrEmpty(MergeFile), "//s \"{0}\"", RootPath(MergeFile, false));
            buffer.AppendIf(!string.IsNullOrEmpty(WorkingDirectory), "//w \"{0}\"", RootPath(WorkingDirectory, false));

            return(buffer.ToString());
        }