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


C# Table.FindInSet方法代码示例

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


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

示例1: It_returns_null_when_no_match_can_be_found

        public void It_returns_null_when_no_match_can_be_found()
        {
            var table = new Table("Field", "Value");
            table.AddRow("String Property", "Peter Keating");

            table.FindInSet(testSet).Should().BeNull();
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:7,代码来源:FindInSetExtensionMethodTests.cs

示例2: Returns_instance_on_partial_match

        public void Returns_instance_on_partial_match()
        {
            var table = new Table("Field", "Value");
            table.AddRow("Int Property", "20");

            var result = table.FindInSet(testSet);

            result.Should().BeSameAs(testSet[1]);
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:9,代码来源:FindInSetExtensionMethodTests.cs

示例3: It_should_throw_if_multiple_results_can_be_found

        public void It_should_throw_if_multiple_results_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");

            Exception exception = null;
            try
            {
                table.FindInSet(records);
            }
            catch (ComparisonException ex)
            {
                exception = ex;
            }

            exception.Should().NotBeNull();
            exception.Message.Should().Be("Multiple instances match the table");
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:22,代码来源:FindInSetExtensionMethodTests.cs

示例4: Returns_null_if_the_property_cannot_be_found

        public void Returns_null_if_the_property_cannot_be_found()
        {
            var table = new Table("Field", "Value");
            table.AddRow("What You Talkin Bout", "Willis");

            table.FindInSet(testSet).Should().BeNull();
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:7,代码来源:FindInSetExtensionMethodTests.cs

示例5: ExceptionWasThrownByThisSearch

 private ComparisonTestResult ExceptionWasThrownByThisSearch(Table table, IEnumerable<InstanceComparisonTestObject> set)
 {
     var result = new ComparisonTestResult { ExceptionWasThrown = false };
     try
     {
         table.FindInSet(set);
     }
     catch (ComparisonException ex)
     {
         result.ExceptionWasThrown = true;
         result.ExceptionMessage = ex.Message;
     }
     return result;
 }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:14,代码来源:FindInSetExtensionMethodTests.cs

示例6: Usage_example

        public void Usage_example()
        {
            var howardRoark = new Person {FirstName = "Howard", LastName = "Roark"};
            var johnGalt = new Person {FirstName = "John", LastName = "Galt"};
            var records = new List<Person> {howardRoark, johnGalt};

            Table table;
            table = new Table("Field", "Value");
            table.AddRow("FirstName", "Howard");

            table.FindInSet(records).Should().Be(howardRoark);

            table = new Table("Field", "Value");
            table.AddRow("LastName", "Galt");

            table.FindInSet(records).Should().Be(johnGalt);

            table = new Table("Field", "Value");
            table.AddRow("LastName", "Keating");

            table.FindInSet(records).Should().BeNull();
        }
开发者ID:tmulkern,项目名称:SpecFlow,代码行数:22,代码来源:FindInSetExtensionMethodTests.cs


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