public void Then1(string batchNumber, Table table)
        {
            var task = CorrectCodelineBus.GetSingleResponseAsync(5);
            task.Wait();

            response = task.Result;

            Assert.IsNotNull(response, "No response received");
            Assert.IsFalse(string.IsNullOrEmpty(response.voucherBatch.scannedBatchNumber));
            Assert.AreEqual(batchNumber, response.voucherBatch.scannedBatchNumber);

            table.CompareToSet(response.voucher.Select(c => new
            {
                documentReferenceNumber = c.documentReferenceNumber.Trim(),
                bsbNumber = c.bsbNumber.Trim(),
                accountNumber = c.accountNumber.Trim(),
                auxDom = c.auxDom.Trim(),
                extraAuxDom = c.extraAuxDom.Trim(),
                transactionCode = c.transactionCode.Trim(),
                amount = c.amount.Trim(),
                targetEndPoint = c.targetEndPoint.Trim(),
                unprocessable = c.unprocessable,
                repostFromDRN = c.repostFromDRN,
                repostFromProcessingDate = (c.repostFromProcessingDate == null) ? string.Empty : ((System.DateTime)c.repostFromProcessingDate).ToString("yyyyMMdd"),
                collectingBank = c.collectingBank
            }));
        }
        public void ThenTheFollowingProductViewModelsShouldExistInTheProductTable(Table table)
        {
            var database = ScenarioContext.Current["Database"] as dynamic;

            IEnumerable<ProductViewModel> productViewModels = database.ProductViewModel.All().Cast<ProductViewModel>();
            table.CompareToSet(productViewModels);
        }
        public void Then1(string batchNumber, Table table)
        {
            var task = CheckThirdPartyBus.GetSingleResponseAsync(5);
            task.Wait();

            response = task.Result;

            Assert.IsNotNull(response, "No response received");
            Assert.IsFalse(string.IsNullOrEmpty(response.voucherBatch.scannedBatchNumber));
            Assert.AreEqual(batchNumber, response.voucherBatch.scannedBatchNumber);

            table.CompareToSet(response.voucher.Select(c => new
            {
                documentReferenceNumber = c.voucher.documentReferenceNumber.Trim(),
                bsbNumber = c.voucher.bsbNumber.Trim(),
                accountNumber = c.voucher.accountNumber.Trim(),
                auxDom = c.voucher.auxDom.Trim(),
                extraAuxDom = c.voucher.extraAuxDom.Trim(),
                transactionCode = c.voucher.transactionCode.Trim(),
                amount = c.voucher.amount.Trim(),
                
                //targetEndPoint = c.voucher.targetEndPoint.Trim(),
                //unprocessable = c.voucher.unprocessable,
                //repostFromDRN = c.voucher.repostFromDRN,
                //repostFromProcessingDate = c.voucher.repostFromProcessingDate.ToString("yyyyMMdd")
            }));
        }
 public void ThenIShouldSeeTheFollowingValuesOnTheWidgetWithDecimalPlaces(int decimalPlaces, Table expectedValues)
 {
     var s =
         WidgetPage.GenerateNephilaStatsTable(
             WidgetPage.ChangeIframeAndreturnDataFromWidget(
                 ".section-content .widget:nth-of-type(3) .chartContainer"));
     expectedValues.CompareToSet(s);
 }
示例#5
0
        public void ThenThereArePeople(Table table)
        {
            var peopleRepo = RecallAidHelper.GetReal<PeopleRepo>();

            var actualPeople = peopleRepo.GetAll();

            table.CompareToSet(actualPeople);
        }
示例#6
0
        public void ThenTheFollowingAdminAccountsShouldExistInTheDatabase(Table table)
        {
            var db = GetTheDatabase();

            IEnumerable<AdminAccount> adminAccounts = db["AdminAccounts"].All().Cast<AdminAccount>();

            table.CompareToSet(adminAccounts.ToList());
        }
        public void AsLatestAdditions(Table table)
        {
            var viewModel = GetTheViewResult();

            var latestsAdded = viewModel.LatestAddedKanbanBoards;

            table.CompareToSet(latestsAdded);
        }
        public void AsMostFavorited(Table table)
        {
            var viewModel = GetTheViewResult();

            var topFavoritedKanbanBoards = viewModel.TopFavoritedKanbanBoards;

            table.CompareToSet(topFavoritedKanbanBoards);
        }
        public void IShouldSeeTheFollowingActivites(Table expectedActivites)
        {
            LatestActionResult.Should().Be.OfType(typeof(ViewResult));  // Asserts that you can read, please
            var viewResult = LatestActionResult as ViewResult;          // Asserts in the Then-step

            var activities = viewResult.Model as IEnumerable<Activity>;
            activities.Should().Not.Be.Null();

            expectedActivites.CompareToSet(activities);
        }
 public void ThenTheFollowingItemsShouldBeInTheList(Table table)
 {
     if (_people != null)
         table.CompareToSet(_people);
     else if (_nullableTypeTesters != null)
         table.CompareToSet(_nullableTypeTesters);
     else if (_dynamicDictionaries != null)
         table.CompareToDynamicSet(_dynamicDictionaries);
     else
         Assert.Fail("No items were found for comparison.");
 }
        public void ListedAsMyBoards(Table table)
        {
            var actionResult = ScenarioContext.Current.Get<ActionResult>();
            actionResult.Should().Be.OfType(typeof(ViewResult));
            var viewResult = actionResult as ViewResult;

            viewResult.ViewData.Model.Should().Be.OfType(typeof(MyBoardsViewModel));
            var vm = viewResult.ViewData.Model as MyBoardsViewModel;

            table.CompareToSet<KanbanBoard>(vm.Boards);
        }
        public void ThenTheFollowingValidationErrorsShouldBeDisplayed(Table table)
        {
            var actualValidationErrors = Enumerable.Empty<ValidationError>();

            var validationSummary = BrowserContext.Current.Browser.FindElement(By.ClassName("validation-summary-errors"));
            if (validationSummary != null)
            {
                actualValidationErrors = validationSummary.FindElements(By.TagName("li")).Select(li => new ValidationError {Message = li.Text});
            }

            table.CompareToSet(actualValidationErrors);
        }
示例#13
0
    public void ThenIAmReturnedADistinctListOfWordsInTheSentenceAndTheNumberOfTimesTheyHaveOccurred(Table table)
    {
      Window window = WordCountingFeature.Window;
      var listView = window.Get<ListView>("WordCountListView");
      window.WaitWhileBusy();
      
      var wordCounts = (from row in listView.Rows
        let word = row.Cells["Word"].Text
        let count = row.Cells["Count"].Text
        select new WordCount {Word = word, Count = count}).ToList();

      table.CompareToSet(wordCounts);
    }
        public void Then1(string batchNumber, Table table)
        {
            var task = CorrectTransactionBus.GetSingleResponseAsync(5);
            task.Wait();

            response = task.Result;

            Assert.IsNotNull(response, "No response received");
            Assert.IsFalse(string.IsNullOrEmpty(response.voucherBatch.scannedBatchNumber));
            Assert.AreEqual(batchNumber, response.voucherBatch.scannedBatchNumber);

            table.CompareToSet(response.voucher);
        }
示例#15
0
        public void CompareToSetShouldNotMatch(Table tableToNotMatch)
        {
            var persons = ScenarioContext.Current.Get<List<Person>>();

            try
            {
                tableToNotMatch.CompareToSet(persons);
            }
            catch (ComparisonException ex)
            {
                ex.Message.Should().Not.Be.Empty();
            }
        }
        public void Then1(string jobIdentifier, Table table)
        {
            if (request == null)
            {
                var task = GetVouchersInformationBus.GetRequestAsync(5);
                task.Wait();

                request = task.Result;

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

            table.CompareToSet(request.Single(_ => _.jobIdentifier == jobIdentifier).searchCriteria);
        }
        public void ThenThereWillBeAMessageInLombard_Service_Outclearings_Recognisecourtesyamount_Response_QueueWithJobIdentifierAndFollowingCARResult(string jobId, Table table)
        {
            var vouchers = table.CreateSet<RecogniseCourtesyAmountResponse>();

            var expectedMessage = new RecogniseBatchCourtesyAmountResponse
            {
                jobIdentifier = jobId,
                voucher = vouchers.ToArray()
            };

            var task = AutoReadCarBus.GetSingleResponseAsync(10, jobId);
            task.Wait();

            var response = task.Result;

            Assert.IsNotNull(response);
            Assert.AreEqual(expectedMessage.jobIdentifier, response.jobIdentifier);
            Assert.AreEqual(expectedMessage.voucher.Length, response.voucher.Length);

            table.CompareToSet(response.voucher);
        }
        public void Then1(string batchNumber, Table table)
        {
            var task = GenerateCorrespondingVoucherBus.GetSingleResponseAsync(5);
            task.Wait();

            response = task.Result;

            Assert.IsNotNull(response, "No response received");
            Assert.IsFalse(string.IsNullOrEmpty(response.generatedVoucher.First().voucherBatch.scannedBatchNumber));
            Assert.AreEqual(batchNumber, response.generatedVoucher.First().voucherBatch.scannedBatchNumber);

            table.CompareToSet(response.generatedVoucher.Select(c => new
            {
                documentReferenceNumber = c.voucher.documentReferenceNumber.Trim(),
                bsbNumber = c.voucher.bsbNumber.Trim(),
                accountNumber = c.voucher.accountNumber.Trim(),
                auxDom = c.voucher.auxDom.Trim(),
                extraAuxDom = c.voucher.extraAuxDom.Trim(),
                transactionCode = c.voucher.transactionCode.Trim(),
                amount = c.voucher.amount.Trim()
            }));
        }
 public void ThenTheSetShouldLookLikeTheFollowing(Table table)
 {
     table.CompareToSet(Persons);
 }
示例#20
0
 public void CheckAnyCellInSet(Table values)
 {
     values.CompareToSet(_cells.CellSet.Select(cell => (TestCell) cell));
 }
        public void ThenAdjustmentLettersResponseWillBeCreated(Table table)
        {
            var task = CreateAdjustmentLettersBus.GetSingleResponseAsync(5);
            task.Wait();

            var response = task.Result;

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

            table.CompareToSet(response.adjustmentLetters);
        }
示例#22
0
 public void Then結果為(Table table)
 {
     var testDatas = ScenarioContext.Current.Get<TestData[]>("Datas");
     table.CompareToSet(testDatas);
 }
 public void ThenIShouldSeeTheFollowingDetails(Table expectedValues)
 {
     expectedValues.CompareToSet(Pages.MyShoppingBagPage.GetTotalQuantityAndSubTotal());
 }
示例#24
0
 public void ThenTheOrderItemViewModelShouldBeAsFollows(Table table)
 {
     var actual = ScenarioContext.Current.Get<List<OrderItemViewModel>>();
     Assert.That(actual, Is.Not.Null);
     table.CompareToSet(actual);
 }
 public void ThenIAmReturnedADistinctListOfWordsInTheSentenceAndTheNumberOfTimesTheyHaveOccurred(Table expectedResults)
 {
     var results = ScenarioContext.Current["Results"] as Dictionary<string, int>;
     expectedResults.CompareToSet(results);
 }
        public void y(Table table)
        {
            IEnumerable<Account> accounts = Database.Open().Accounts.All().Cast<Account>();

            table.CompareToSet(accounts);
        }
示例#27
0
 public void ThenTheProfileViewModelShouldHaveFollowingErrors(Table table)
 {
     var model = ScenarioContext.Current.Get<ProfileViewModel>();
     table.CompareToSet(model.BrokenRules);
 }
示例#28
0
        public void ThenMySearchResultsShouldInclude(Table table)
        {
            var results = ScenarioContext.Current.Get<IEnumerable<QueryResult<int>>>();

            table.CompareToSet(results);
        }
示例#29
0
        public void Then查詢結果應為(Table table)
        {
            var actual = ScenarioContext.Current.Get<IEnumerable<MyOrder>>();

            table.CompareToSet<MyOrder>(actual);
        }
 public void 那麼得到商品(Table table)
 {
     table.CompareToSet<ProductForCategoryModel>(this.productResult);
 }