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


C# Table.CompareToInstance方法代码示例

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


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

示例1: ExceptionWasThrownByThisComparison

 private static ComparisonTestResult ExceptionWasThrownByThisComparison(Table table, InstanceComparisonTestObject test)
 {
     var result = new ComparisonTestResult { ExceptionWasThrown = false };
     try
     {
         table.CompareToInstance(test);
     }
     catch (ComparisonException ex)
     {
         result.ExceptionWasThrown = true;
         result.ExceptionMessage = ex.Message;
     }
     return result;
 }
开发者ID:roffster,项目名称:SpecFlow,代码行数:14,代码来源:InstanceComparisonExtensionMethodsTests.cs

示例2: GetExceptionThrownByThisComparison

 private static ComparisonException GetExceptionThrownByThisComparison(Table table, InstanceComparisonTestObject test)
 {
     try
     {
         table.CompareToInstance(test);
     }
     catch (ComparisonException ex)
     {
         return ex;
     }
     return null;
 }
开发者ID:roffster,项目名称:SpecFlow,代码行数:12,代码来源:InstanceComparisonExtensionMethodsTests.cs

示例3: Should_be_able_to_compare_the_fancy_name

        public void Should_be_able_to_compare_the_fancy_name()
        {
            Service.Instance.RegisterValueRetriever(new FancyNameValueRetriever());
            Service.Instance.RegisterValueComparer(new FancyNameValueComparer());

            var table = new Table("Field", "Value");
            table.AddRow("Name", "John Galt");

            var expectedName = new FancyName() { FirstName = "John", LastName = "Galt" };
            var expectedLad  = new FancyLad() { Name = expectedName };

            table.CompareToInstance<FancyLad>(expectedLad);
        }
开发者ID:ethanmoffat,项目名称:SpecFlow,代码行数:13,代码来源:WorkingExampleOfValueRetrieverAndComparerAddition.cs

示例4: ThenTheExecutionSummaryShouldContain

 public void ThenTheExecutionSummaryShouldContain(Table expectedSummary)
 {
     testExecutionResult.LastExecutionSummary.ShouldNotBeNull();
     expectedSummary.CompareToInstance(testExecutionResult.LastExecutionSummary);
 }
开发者ID:BEllis,项目名称:SpecFlow,代码行数:5,代码来源:ExecutionResultSteps.cs

示例5: Should_be_able_to_compare_the_category

        public void Should_be_able_to_compare_the_category()
        {
            Service.Instance.RegisterValueRetriever(new ProductCategoryValueRetriever());
            Service.Instance.RegisterValueComparer(new ProductCategoryValueComparer());

            var table = new Table("Field", "Value");
            table.AddRow("Name", "Cucumber");
            table.AddRow("Category", "Vegetable");

            var expectedCategory = new ProductCategory() { Name = "Vegetable" };
            var expectedProduct = new Product() { Name = "Cucumber", Category = expectedCategory };

            table.CompareToInstance<Product>(expectedProduct);
        }
开发者ID:ethanmoffat,项目名称:SpecFlow,代码行数:14,代码来源:WorkingExampleOfValueRetrieverAndComparerAddition.cs


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