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


C# Table.ToValidationTable方法代码示例

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


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

示例1: TestToValidationTableWhenTableIsEmptyThrowsException

        public void TestToValidationTableWhenTableIsEmptyThrowsException()
        {
            var table = new Table("Field", "Rule", "Value");

            ExceptionHelper.SetupForException<ElementExecuteException>(
                () => table.ToValidationTable(),
                ex => Assert.AreEqual("The validation table must contain at least one validation row.", ex.Message));
        }
开发者ID:kristerbone,项目名称:specbind,代码行数:8,代码来源:ValidationTableExtensionsFixture.cs

示例2: TestToValidationTableWhenValueColumnIsMissingThrowsException

        public void TestToValidationTableWhenValueColumnIsMissingThrowsException()
        {
            var table = new Table("Field", "Rule");

            ExceptionHelper.SetupForException<ElementExecuteException>(
                () => table.ToValidationTable(),
                ex => Assert.AreEqual(InvalidColumnErrorMessage, ex.Message));
        }
开发者ID:kristerbone,项目名称:specbind,代码行数:8,代码来源:ValidationTableExtensionsFixture.cs

示例3: GoToListItemWithCriteriaStep

        public void GoToListItemWithCriteriaStep(string listName, Table criteriaTable)
        {
            var page = this.GetPageFromContext();
            var validationTable = criteriaTable.ToValidationTable();

            var context = new GetListItemByCriteriaAction.ListItemByCriteriaContext(listName.ToLookupKey(), validationTable);

            var item = this.actionPipelineService.PerformAction<GetListItemByCriteriaAction>(page, context)
                                                 .CheckResult<IPage>();

            this.UpdatePageContext(item);
        }
开发者ID:kristerbone,项目名称:specbind,代码行数:12,代码来源:SelectionSteps.cs

示例4: ThenISeeStep

        public void ThenISeeStep(Table data)
        {
            var validations = data.ToValidationTable();
            var page = this.GetPageFromContext();

            var context = new ValidateItemAction.ValidateItemContext(validations);
            this.actionPipelineService.PerformAction<ValidateItemAction>(page, context).CheckResult();
        }
开发者ID:DavidPx,项目名称:specbind,代码行数:8,代码来源:DataSteps.cs

示例5: ThenISeeListStep

        public void ThenISeeListStep(string fieldName, string rule, Table data)
        {
            if (data == null || data.RowCount == 0)
            {
                return;
            }

            ComparisonType comparisonType;
            switch (rule.ToLookupKey())
            {
                case "exists":
                case "contains":
                    comparisonType = ComparisonType.Contains;
                    break;

                case "doesnotexist":
                case "doesnotcontain":
                    comparisonType = ComparisonType.DoesNotContain;
                    break;

                case "startswith":
                    comparisonType = ComparisonType.StartsWith;
                    break;

                case "endswith":
                    comparisonType = ComparisonType.EndsWith;
                    break;
                case "equals":
                    comparisonType = ComparisonType.Equals;
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Rule type '{0}' is not supported.", rule));
            }

            var page = this.GetPageFromContext();
            var validations = data.ToValidationTable();

            var context = new ValidateListAction.ValidateListContext(fieldName.ToLookupKey(), comparisonType, validations);
            this.actionPipelineService.PerformAction<ValidateListAction>(page, context).CheckResult();
        }
开发者ID:DavidPx,项目名称:specbind,代码行数:40,代码来源:DataSteps.cs

示例6: TestToValidationTableWhenTableIsPopulatedReturnsValidationTable

        public void TestToValidationTableWhenTableIsPopulatedReturnsValidationTable()
        {
            var table = new Table("Field", "Rule", "Value");
            table.AddRow("My Column", "equals", "Foo");

            var validationTable = table.ToValidationTable();

            Assert.IsNotNull(validationTable);
            Assert.AreEqual(1, validationTable.ValidationCount);

            var item = validationTable.Validations.First();
            Assert.AreEqual("My Column", item.RawFieldName);
            Assert.AreEqual("Foo", item.RawComparisonValue);
            Assert.AreEqual("equals", item.RawComparisonType);
        }
开发者ID:kristerbone,项目名称:specbind,代码行数:15,代码来源:ValidationTableExtensionsFixture.cs


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