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); }
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); }
public void CompareToInstanceShouldNotMatch(Table instanceTableToNotMatch) { var p = ScenarioContext.Current.Get<Person>(); try { instanceTableToNotMatch.CompareToInstance(p); } catch (ComparisonException ex) { ex.Message.Should().Not.Be.Empty(); } }
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(); } }
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); } }
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); }
public void ThenIGetTheRule(Table table) { var rule = ScenarioContext.Current.Get<Rule>("response invoice from John Galt"); table.CompareToInstance(rule); }
public void Then3(string batchNumber, Table table) { table.CompareToInstance(response.generatedVoucher.First().voucherBatch); }
private static ComparisonException GetExceptionThrownByThisComparison(Table table, ComparisonTest test) { try { table.CompareToInstance(test); } catch (ComparisonException ex) { return ex; } return null; }
private static bool ExceptionWasThrownByThisComparison(Table table, ComparisonTest test) { var exception = false; try { table.CompareToInstance(test); } catch (ComparisonException ex) { exception = true; } return exception; }
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); }
public void ThenTheOrderViewModelShouldBeAsFollows(Table table) { var actual = ScenarioContext.Current.Get<OrderViewModel>(); Assert.That(actual, Is.Not.Null); table.CompareToInstance(actual); }
public void 那麼GiftModel為(Table table) { table.CompareToInstance(this.gift); }
public void ThenIShouldHaveTheFollowingDeliveryAddressAsAResult(Table table) { var actual = ScenarioContext.Current.Get<DeliveryAddressViewModel>("actualInstance"); Assert.That(actual, Is.Not.Null); table.CompareToInstance(actual); }
public void ThenISeeThreadsInTable(Table table) { var threads = ScenarioContext.Current.Get<Thread>(); table.CompareToInstance<Thread>(threads); }
public void ThenTheProfileViewModelShouldBeAsFollows(Table table) { var model = ScenarioContext.Current.Get<ProfileViewModel>(); table.CompareToInstance(model); }
public void Then3(string batchNumber, Table table) { table.CompareToInstance(response.transactions.First().bulkCreditVoucher.voucherBatch); }
public void CompareToInstanceShouldMatch(Table instanceTableToMatch) { var p = ScenarioContext.Current.Get<Person>(); instanceTableToMatch.CompareToInstance(p); }
public void Then2(string batchNumber, Table table) { table.CompareToInstance(response.voucherBatch); }
public void 那麼ProductModel為(Table table) { table.CompareToInstance(this.model); }