示例#1
0
        public void ThenTheAccountWithNumberShouldContainTheseEntries(string accountNumber, EntryTable expectedEntries)
        {
            EntryRow[] expectedRows = expectedEntries.Entries.ToArray();
              Entry[] actualEntries = CurrentScenarioContext.EasyBankContext[accountNumber].Entries.ToArray();

              Assert.AreEqual(expectedRows.Length, actualEntries.Length);

              for (int i = 0; i < expectedRows.Length; i++)
              {
            AssertEntry(expectedRows[i], actualEntries[i], i);
              }
        }
        public void GivenTheFollowingEntriesInThatAccount(string accountNumber, EntryTable entryTable)
        {
            var entries = entryTable.Entries.Select(
            e =>
              new Entry(
              account: e.Account,
              amountIn: e.AmountIn,
              amountOut: e.AmountOut,
              bookingDate: e.BookingDate,
              currency: e.Currency,
              description: e.Description,
              payee: e.Payee,
              valueDate: e.ValueDate)
              { IsNew = e.IsNew }).ToArray();

              foreach (var entry in entries)
              {
            CurrentScenarioContext.EasyBankContext[accountNumber].AddEntry(entry);
              }
        }