本文整理汇总了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));
}
示例2: TestToValidationTableWhenValueColumnIsMissingThrowsException
public void TestToValidationTableWhenValueColumnIsMissingThrowsException()
{
var table = new Table("Field", "Rule");
ExceptionHelper.SetupForException<ElementExecuteException>(
() => table.ToValidationTable(),
ex => Assert.AreEqual(InvalidColumnErrorMessage, ex.Message));
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}