当前位置: 首页>>代码示例>>C#>>正文


C# ITestContext.ResultsFor方法代码示例

本文整理汇总了C#中ITestContext.ResultsFor方法的典型用法代码示例。如果您正苦于以下问题:C# ITestContext.ResultsFor方法的具体用法?C# ITestContext.ResultsFor怎么用?C# ITestContext.ResultsFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITestContext的用法示例。


在下文中一共展示了ITestContext.ResultsFor方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: execute

        protected override void execute(IWebElement element, IDictionary<string, object> cellValues, IStep step, ITestContext context)
        {
            // TODO -- StoryTeller needs to pull this all inside the Cell
            if (!cellValues.ContainsKey(_cell.Key))
            {
                // already caught as a syntax error
                return;
            }

            var handler = ElementHandlers.FindHandler(element);
            var expectedValue = cellValues[_cell.Key];

            var matchingHandler = handler as IMatchingHandler ?? new BasicMatchingHandler(handler, context);

            if (matchingHandler.MatchesData(element, expectedValue))
            {
                context.IncrementRights();
            }
            else
            {
                context.ResultsFor(step).MarkFailure(_cell.Key);
                context.IncrementWrongs();
            }

            context.ResultsFor(step).SetActual(_cell.Key, handler.GetData(CurrentContext, element));
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:26,代码来源:CheckValueGrammar.cs

示例2: WriteResults

        public void WriteResults(ITestContext context)
        {
            context.ResultsFor(_step).ForExceptionText(writeExceptionText);

            rows().Each(row => writeResultsRow(row, context));

            _headerRow.FirstChild().AddClass("left-cell");
        }
开发者ID:GaryLCoxJr,项目名称:storyteller,代码行数:8,代码来源:StoryTellerTableTag.cs

示例3: WriteResults

        public void WriteResults(ITestContext context)
        {
            // This code Dru.  If there's an exception in the results, call
            // back to the writeExceptionText(string) method to write in
            // the exception
            context.ResultsFor(_step).ForExceptionText(writeExceptionText);

            rows().Each(row => writeResultsRow(row, context));
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:9,代码来源:StoryTellerTableTag.cs

示例4: Execute

        public void Execute(IStep containerStep, ITestContext context)
        {
            var actualObjects = findTheObjects(containerStep, context);
            var actualRows = buildActualRows(actualObjects);
            var expectedRows = buildExpectedRows(context, containerStep);

            var matcher = new SetRowMatcher(expectedRows, actualRows, context);
            IList<SetRow> results = Ordered ? matcher.CompareOrdered() : matcher.Compare();

            markCounts(context, results);

            context.ResultsFor(containerStep).SetResult(results, _leafName);
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:13,代码来源:SetVerificationGrammar.cs

示例5: WriteSetVerificationResults

        public void WriteSetVerificationResults(SetVerification verification, ITestContext context)
        {
            if (verification.Ordered)
            {
                _headerRow.InsertFirst(new HtmlTag("th").Text("Order"));
            }

            var results = context.ResultsFor(_step);
            results.ForExceptionText(writeExceptionText);

            var rows = results.GetResult<IList<SetRow>>(_table.LeafName) ?? new List<SetRow>();
            // TODO -- order this the right way

            rows.Each(x =>
            {
                writeVerificationResultRow(x, context, verification.Ordered);
            });
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:18,代码来源:StoryTellerTableTag.cs

示例6: WriteResults

        public void WriteResults(ITestContext context)
        {
            write(new Results(this, context));

            var results = context.ResultsFor(_step);
            if (results.HasErrors())
            {
                AddClass(HtmlClasses.EXCEPTION);
                Next = new ExceptionTag(results.ExceptionText);
            }
            else
            {
                if (_sentence.IsFact)
                {
                    var success = (bool)results.GetActual(_sentence.ResultCell.Key);
                    var className = success ? HtmlClasses.PASS : HtmlClasses.FAIL;
                    AddClass(className);
                }
            }
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:20,代码来源:SentenceTag.cs

示例7: writeVerificationResultRow

        private void writeVerificationResultRow(SetRow setRow, ITestContext context, bool ordered)
        {
            AddBodyRow(row =>
            {
                if (ordered)
                {
                    row.Cell(setRow.ActualOrder == 0 ? string.Empty : setRow.ActualOrder.ToString());
                }

                _table.Cells.Each(cell =>
                {
                    var display = context.GetDisplay(setRow.Values[cell.Key]);
                    row.Cell(display);
                });

                switch (setRow.Result)
                {
                    case SetMatch.Match:
                        row.AddClass(HtmlClasses.PASS);

                        break;

                    case SetMatch.Extra:
                        row.AddClass(HtmlClasses.FAIL);
                        var firstChild = row.FirstChild();
                        firstChild.Text("Extra:  " + firstChild.Text());
                        break;

                    case SetMatch.Missing:
                        row.AddClass(HtmlClasses.FAIL);
                        var tag = row.FirstChild();
                        tag.Text("Missing:  " + tag.Text());
                        break;

                    case SetMatch.OutOfOrder:
                        row.AddClass(HtmlClasses.FAIL);

                        string text = "Expected {0} but was {1}".ToFormat(setRow.ExpectedOrder, setRow.ActualOrder);
                        row.FirstChild().Text(text);
                        break;
                }

                row.FirstChild().AddClass("left-cell");
            });

            if (setRow.Step != null)
            {
                context.ResultsFor(setRow.Step).ForExceptionText(writeExceptionText);
            }
        }
开发者ID:GaryLCoxJr,项目名称:storyteller,代码行数:50,代码来源:StoryTellerTableTag.cs

示例8: writeResultsRow

        private void writeResultsRow(IStep step, ITestContext context)
        {
            AddBodyRow(row =>
            {
                StepResults results = context.ResultsFor(step);
                results.Collapse();

                _writer.DisplayCells.Each(cell =>
                {

                    var tag = new CellTag(cell, step);
                    tag.TagName("td");
                    row.Append(tag);

                    tag.WriteResults(results, context);
                });

                row.FirstChild().AddClass("left-cell");

                results.ForExceptionText(writeExceptionText);
            });
        }
开发者ID:GaryLCoxJr,项目名称:storyteller,代码行数:22,代码来源:StoryTellerTableTag.cs

示例9: WriteResults

 public void WriteResults(ITestContext context)
 {
     context.ResultsFor(_section).ForExceptionText(text => _body.Append(new ExceptionTag(text)));
 }
开发者ID:adymitruk,项目名称:storyteller,代码行数:4,代码来源:EmbeddedSectionTag.cs

示例10: WriteResults

 public void WriteResults(ITestContext context)
 {
     context.ResultsFor(_step).ForExceptionText(text => Child(new ExceptionTag(text)));
 }
开发者ID:abombss,项目名称:storyteller,代码行数:4,代码来源:EmbeddedSectionTag.cs

示例11: Results

 public Results(SentenceTag tag, ITestContext context)
 {
     _tag = tag;
     _context = context;
     _results = _context.ResultsFor(tag._step);
     _step = tag._step;
 }
开发者ID:wbinford,项目名称:storyteller,代码行数:7,代码来源:SentenceTag.cs

示例12: writeResultsRow

        private void writeResultsRow(IStep step, ITestContext context)
        {
            AddBodyRow(row =>
            {
                _table.Cells.Each(cell =>
                {
                    StepResults results = context.ResultsFor(step);
                    var tag = new CellTag(cell, _step);
                    tag.WriteResults(results, context);

                    // Ditto this line of code
                    results.ForExceptionText(writeExceptionText);

                    row.Cell().Child(tag);
                });
            });
        }
开发者ID:wbinford,项目名称:storyteller,代码行数:17,代码来源:StoryTellerTableTag.cs


注:本文中的ITestContext.ResultsFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。