本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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);
}
}
示例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);
}
示例6: ThenIGetTheRule
public void ThenIGetTheRule(Table table)
{
var rule = ScenarioContext.Current.Get<Rule>("response invoice from John Galt");
table.CompareToInstance(rule);
}
示例7: Then3
public void Then3(string batchNumber, Table table)
{
table.CompareToInstance(response.generatedVoucher.First().voucherBatch);
}
示例8: GetExceptionThrownByThisComparison
private static ComparisonException GetExceptionThrownByThisComparison(Table table, ComparisonTest test)
{
try
{
table.CompareToInstance(test);
}
catch (ComparisonException ex)
{
return ex;
}
return null;
}
示例9: ExceptionWasThrownByThisComparison
private static bool ExceptionWasThrownByThisComparison(Table table, ComparisonTest test)
{
var exception = false;
try
{
table.CompareToInstance(test);
}
catch (ComparisonException ex)
{
exception = true;
}
return exception;
}
示例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);
}
示例11: ThenTheOrderViewModelShouldBeAsFollows
public void ThenTheOrderViewModelShouldBeAsFollows(Table table)
{
var actual = ScenarioContext.Current.Get<OrderViewModel>();
Assert.That(actual, Is.Not.Null);
table.CompareToInstance(actual);
}
示例12:
public void 那麼GiftModel為(Table table)
{
table.CompareToInstance(this.gift);
}
示例13: ThenIShouldHaveTheFollowingDeliveryAddressAsAResult
public void ThenIShouldHaveTheFollowingDeliveryAddressAsAResult(Table table)
{
var actual = ScenarioContext.Current.Get<DeliveryAddressViewModel>("actualInstance");
Assert.That(actual, Is.Not.Null);
table.CompareToInstance(actual);
}
示例14: ThenISeeThreadsInTable
public void ThenISeeThreadsInTable(Table table)
{
var threads = ScenarioContext.Current.Get<Thread>();
table.CompareToInstance<Thread>(threads);
}
示例15: ThenTheProfileViewModelShouldBeAsFollows
public void ThenTheProfileViewModelShouldBeAsFollows(Table table)
{
var model = ScenarioContext.Current.Get<ProfileViewModel>();
table.CompareToInstance(model);
}