public void GivenReaderThatReturnsSomeResults_WhenMatcherReturnsFalse_BankTransfersAreStored() { const string accountNumber1 = "123ABC"; const string accountNumber2 = "123ABCDE"; var storeSpy = new BankTransferStoreSpy(); new BankTransferImporter( new ReaderThatReturnsPreSetList( new List <BankTransferLine> { new BankTransferLine { AccountNumber = accountNumber1 } , new BankTransferLine { AccountNumber = accountNumber2 } }), new BankTransferMatcherIndicatingNoTransfersAlreadyExists(), storeSpy).Execute(); Assert.IsNotEmpty(storeSpy.ProcessedRequests); Assert.AreEqual(2, storeSpy.ProcessedRequests.Count); Assert.IsTrue(storeSpy.ProcessedRequests.Any(p => p.AccountNumber == accountNumber1)); Assert.IsTrue(storeSpy.ProcessedRequests.Any(p => p.AccountNumber == accountNumber2)); }
public void GivenReaderThatReturnsEmptyList_NoExceptionIsRaisedAndNoBankTransfersAreStored() { var storeSpy = new BankTransferStoreSpy(); new BankTransferImporter(new ReaderThatReturnsEmptyList(), null, storeSpy).Execute(); Assert.IsEmpty(storeSpy.ProcessedRequests); }
public void GivenReaderThatReturnsSomeResults_WhenMatcherReturnsTrue_NoExceptionsIsRaisedAndNoBanktransfersAreStored() { var storeSpy = new BankTransferStoreSpy(); new BankTransferImporter( new ReaderThatReturnsPreSetList(new List <BankTransferLine> { new BankTransferLine() }), new BankTransferMatcherIndicatingAllTransfersAlreadyExist(), storeSpy).Execute(); Assert.IsEmpty(storeSpy.ProcessedRequests); }