本文整理汇总了C#中Table.FindAllInSet方法的典型用法代码示例。如果您正苦于以下问题:C# Table.FindAllInSet方法的具体用法?C# Table.FindAllInSet怎么用?C# Table.FindAllInSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table.FindAllInSet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Returns_nothing_if_the_match_cannot_be_found
public void Returns_nothing_if_the_match_cannot_be_found()
{
var table = new Table("Field", "Value");
table.AddRow("What You Talkin Bout", "Willis");
table.FindAllInSet(testSet).Count().Should().Be(0);
}
示例2: It_returns_nothing_when_no_match_could_be_found
public void It_returns_nothing_when_no_match_could_be_found()
{
var table = new Table("Field", "Value");
table.AddRow("String Property", "Peter Keating");
table.FindAllInSet(testSet).Count().Should().Be(0);
}
示例3: Returns_match_on_partial_match
public void Returns_match_on_partial_match()
{
var table = new Table("Field", "Value");
table.AddRow("Int Property", "20");
var results = table.FindAllInSet(testSet);
results.Count().Should().Be(1);
results.First().IntProperty.Should().Be(20);
}
示例4: It_should_return_multiple_matches_if_they_can_be_Found
public void It_should_return_multiple_matches_if_they_can_be_Found()
{
var john = new Person {FirstName = "John", LastName = "Doe"};
var jane = new Person {FirstName = "Jane", LastName = "Doe"};
var records = new List<Person> { john, jane};
var table = new Table("Field", "Value");
table.AddRow("LastName", "Doe");
var results = table.FindAllInSet(records);
results.Count().Should().Be(2);
results.Should().Contain(john);
results.Should().Contain(jane);
}
示例5: Usage_example
public void Usage_example()
{
var john = new Person {FirstName = "John", LastName = "Doe"};
var jane = new Person {FirstName = "Jane", LastName = "Doe"};
var records = new List<Person> {john, jane};
Table table;
table = new Table("Field", "Value");
table.AddRow("FirstName", "John");
table.FindAllInSet(records).Count().Should().Be(1);
table.FindAllInSet(records).Should().Contain(john);
table = new Table("Field", "Value");
table.AddRow("LastName", "Doe");
table.FindAllInSet(records).Count().Should().Be(2);
table.FindAllInSet(records).Should().Contain(john);
table.FindAllInSet(records).Should().Contain(jane);
table = new Table("Field", "Value");
table.AddRow("LastName", "Trump");
table.FindAllInSet(records).Count().Should().Be(0);
}