コード例 #1
0
 public void AddFeature(FeatureData data)
 {
     foreach (var writer in writers)
     {
         writer.AddFeature(data);
     }
 }
コード例 #2
0
 public void AddFeature(FeatureData data)
 {
     consoleReport.AppendLine(data.title);
     consoleReport.AppendLine(data.featureResult);
     consoleReport.AppendLine(data.featureEvidence.BuildEvidenceForConsole());
     consoleReport.AppendLine(messages.Divider);
 }
コード例 #3
0
ファイル: Output.cs プロジェクト: FairlyLinearDynamics/YoCode
        public Output(IPrint printTo, string outputPath = null, IErrorReporter errorReporter = null)
        {
            outputWriter = printTo;

            errOutput = errorReporter ?? new NullErrorObject();

            featData = new FeatureData();

            writeTo = outputPath;
        }
コード例 #4
0
        public void AddFeature(FeatureData data)
        {
            var featureResults = new StringBuilder();

            featureResults.Append(WebElementBuilder.FormatParagraph(data.featureResult));
            featureResults.Append(data.featureEvidence.BuildEvidenceForHTML());
            string featureTitle;

            switch (data.featurePass)
            {
            case true:
                featureTitle = WebElementBuilder.FormatPassedFeatureTitle(new WebTitleElements()
                {
                    score     = data.score + "%",
                    rawScore  = data.rawScore + "%",
                    weighting = data.weighting.ToString(),
                    title     = data.title,
                });
                break;

            case false:
                featureTitle = WebElementBuilder.FormatFailedFeatureTitle(new WebTitleElements()
                {
                    score     = data.score + "%",
                    rawScore  = data.rawScore + "%",
                    weighting = data.weighting.ToString(),
                    title     = data.title,
                });
                break;

            default:
                const char dash = (char)0x2013;
                featureTitle = WebElementBuilder.FormatInconclusiveFeatureTitle(new WebTitleElements()
                {
                    score     = dash.ToString(),
                    rawScore  = dash.ToString(),
                    weighting = dash.ToString(),
                    title     = data.title,
                });
                break;
            }

            features.Append(WebElementBuilder.FormatAccordionElement(new WebAccordionData()
            {
                featureTitle  = featureTitle,
                content       = featureResults.ToString(),
                helperMessage = data.featureHelperMessage,
            }));
        }