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);
        }
Example #3
0
 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();
            }
        }
Example #5
0
 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);
        }
Example #7
0
 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;
 }
Example #11
0
 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);
 }
Example #15
0
        public void ThenISeeThreadsInTable(Table table)
        {
            var threads = ScenarioContext.Current.Get<Thread>();

            table.CompareToInstance<Thread>(threads);
        }
Example #16
0
 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);
 }
Example #18
0
 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);
 }