當前位置: 首頁>>代碼示例>>C#>>正文


C# Table.CompareToInstance方法代碼示例

本文整理匯總了C#中TechTalk.SpecFlow.Table.CompareToInstance方法的典型用法代碼示例。如果您正苦於以下問題:C# Table.CompareToInstance方法的具體用法?C# Table.CompareToInstance怎麽用?C# Table.CompareToInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TechTalk.SpecFlow.Table的用法示例。


在下文中一共展示了Table.CompareToInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ThenHeShouldSeeAnAdminAccountEditFormWithTheFollowingValues

        public void ThenHeShouldSeeAnAdminAccountEditFormWithTheFollowingValues(Table table)
        {
            var actionResult = ScenarioContext.Current.Get<ActionResult>();
            var viewResult = ((ViewResult) actionResult);

            viewResult.Model.ShouldBeType(typeof (AdminAccountEditForm));

            var editForm = (AdminAccountEditForm) viewResult.Model;

            table.CompareToInstance(editForm);
        }
開發者ID:burkhartt,項目名稱:Bennington,代碼行數:11,代碼來源:AdminAccountEditFormSteps.cs

示例2: ThenAnIncidentMessageIsSentToTheIncidentServiceExchangeWithRoutingKeyEmpty

        public void ThenAnIncidentMessageIsSentToTheIncidentServiceExchangeWithRoutingKeyEmpty(string routingKey, Table table)
        {
            var task = IncidentBus.GetSingleResponseAsync(5);
            task.Wait();

            var response = task.Result;

            Assert.IsNotNull(response, "No response received");

            table.CompareToInstance(response);
        }
開發者ID:jhonner72,項目名稱:plat,代碼行數:11,代碼來源:CreateIncidentFromRequestSteps.cs

示例3: CompareToSetShouldNotMatch

        public void CompareToSetShouldNotMatch(Table tableToNotMatch)
        {
            var persons = ScenarioContext.Current.Get<List<Person>>();

            try
            {
                tableToNotMatch.CompareToInstance(persons);
            }
            catch (ComparisonException ex)
            {
                ex.Message.Should().Not.Be.Empty();
            }
        }
開發者ID:darrencauthon,項目名稱:ProgressiveNetDemos,代碼行數:13,代碼來源:CompareToSteps.cs

示例4: ThenTheSigninResultShouldBeAsFollows

 public void ThenTheSigninResultShouldBeAsFollows(Table table)
 {
     var result = ScenarioContext.Current.Get<ViewResult>("controllerResponse");
     Assert.That(result, Is.Not.Null);
     var mainViewModel = result.Model as MainViewModel;
     Assert.That(mainViewModel, Is.Not.Null);
     if (mainViewModel != null)
     {
         var actual = mainViewModel.SignInViewModel;
         Assert.That(actual, Is.Not.Null);
         table.CompareToInstance(actual);
     }
 }
開發者ID:Naviam,項目名稱:Shop-Any-Ware,代碼行數:13,代碼來源:SignInSteps.cs

示例5: ThenTheQuestionShouldAppearAtTheEndOfTheQuestionListAs

        public void ThenTheQuestionShouldAppearAtTheEndOfTheQuestionListAs(Table expectedQuestion)
        {
            var actualQuestions = BrowserContext.Current.Browser.FindElements(By.ClassName("question-info"))
                .Select(qi => new Question
                {
                    Title = qi.FindElement(By.ClassName("body")).Text,
                    Views = int.Parse(qi.FindElement(By.CssSelector(".views span")).Text),
                    Votes = int.Parse(qi.FindElement(By.CssSelector(".votes span")).Text)
                });

            var lastQuestion = actualQuestions.Last();

            expectedQuestion.CompareToInstance(lastQuestion);
        }
開發者ID:gasparnagy,項目名稱:CodeExample-SpecFlow-LivingHelp,代碼行數:14,代碼來源:AskSteps.cs

示例6: ThenIGetTheRule

 public void ThenIGetTheRule(Table table)
 {
     var rule = ScenarioContext.Current.Get<Rule>("response invoice from John Galt");
     table.CompareToInstance(rule);
 }
開發者ID:RoyGI,項目名稱:Specflow-Demo,代碼行數:5,代碼來源:ChainSteps.cs

示例7: Then3

 public void Then3(string batchNumber, Table table)
 {
     table.CompareToInstance(response.generatedVoucher.First().voucherBatch);
 }
開發者ID:jhonner72,項目名稱:plat,代碼行數:4,代碼來源:GenerateCorrespondingVoucherResponsePollingJobSteps.cs

示例8: GetExceptionThrownByThisComparison

 private static ComparisonException GetExceptionThrownByThisComparison(Table table, ComparisonTest test)
 {
     try
     {
         table.CompareToInstance(test);
     }
     catch (ComparisonException ex)
     {
         return ex;
     }
     return null;
 }
開發者ID:darrencauthon,項目名稱:SpecFlowAssist,代碼行數:12,代碼來源:InstanceComparisonExtensionMethodsTests.cs

示例9: ExceptionWasThrownByThisComparison

 private static bool ExceptionWasThrownByThisComparison(Table table, ComparisonTest test)
 {
     var exception = false;
     try
     {
         table.CompareToInstance(test);
     }
     catch (ComparisonException ex)
     {
         exception = true;
     }
     return exception;
 }
開發者ID:darrencauthon,項目名稱:SpecFlowAssist,代碼行數:13,代碼來源:InstanceComparisonExtensionMethodsTests.cs

示例10: ThenIShouldHaveTheResultAsFollows

 public void ThenIShouldHaveTheResultAsFollows(Table table)
 {
     var actual = ScenarioContext.Current.Get<ViewResult>("controllerResponse");
     Assert.That(actual, Is.Not.Null);
     var mainModel = actual.Model as MainViewModel;
     Assert.That(mainModel, Is.Not.Null);
     Debug.Assert(mainModel != null, "mainModel != null");
     Assert.That(mainModel.SignUpViewModel, Is.Not.Null);
     table.CompareToInstance(mainModel.SignUpViewModel);
 }
開發者ID:Naviam,項目名稱:Shop-Any-Ware,代碼行數:10,代碼來源:SignUpSteps.cs

示例11: ThenTheOrderViewModelShouldBeAsFollows

 public void ThenTheOrderViewModelShouldBeAsFollows(Table table)
 {
     var actual = ScenarioContext.Current.Get<OrderViewModel>();
     Assert.That(actual, Is.Not.Null);
     table.CompareToInstance(actual);
 }
開發者ID:Naviam,項目名稱:Shop-Any-Ware,代碼行數:6,代碼來源:ShopperOrdersSteps.cs

示例12:

 public void 那麼GiftModel為(Table table)
 {
     table.CompareToInstance(this.gift);
 }
開發者ID:WiliamWu,項目名稱:Api-Sample,代碼行數:4,代碼來源:字串轉換為Gift功能步驟.cs

示例13: ThenIShouldHaveTheFollowingDeliveryAddressAsAResult

 public void ThenIShouldHaveTheFollowingDeliveryAddressAsAResult(Table table)
 {
     var actual = ScenarioContext.Current.Get<DeliveryAddressViewModel>("actualInstance");
     Assert.That(actual, Is.Not.Null);
     table.CompareToInstance(actual);
 }
開發者ID:Naviam,項目名稱:Shop-Any-Ware,代碼行數:6,代碼來源:DeliveryAddressesSteps.cs

示例14: ThenISeeThreadsInTable

        public void ThenISeeThreadsInTable(Table table)
        {
            var threads = ScenarioContext.Current.Get<Thread>();

            table.CompareToInstance<Thread>(threads);
        }
開發者ID:bwrobel,項目名稱:Experts,代碼行數:6,代碼來源:ThreadsListSteps.cs

示例15: ThenTheProfileViewModelShouldBeAsFollows

 public void ThenTheProfileViewModelShouldBeAsFollows(Table table)
 {
     var model = ScenarioContext.Current.Get<ProfileViewModel>();
     table.CompareToInstance(model);
 }
開發者ID:Naviam,項目名稱:Shop-Any-Ware,代碼行數:5,代碼來源:ProfileSteps.cs


注:本文中的TechTalk.SpecFlow.Table.CompareToInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。