Created
April 18, 2021 06:49
-
-
Save goldbergyoni/28ea44bf669e50bd8c32d82aa1375d1d to your computer and use it in GitHub Desktop.
Clean tests - Better test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test("When no credit, the declined transfer does not appear in sender history", () => { | |
| // Arrange | |
| const transferRequest = testHelpers.factorMoneyTransfer({ | |
| sender: { credit: 50 }, | |
| transferAmount: 100, | |
| }); | |
| const transferServiceUnderTest = new TransferService({ creditPolicy: "NoCredit" }); | |
| // Act | |
| transferServiceUnderTest.transfer(transferRequest); | |
| // Assert | |
| const senderTransfersHistory = transferServiceUnderTest.getTransfers(transferRequest.sender.name); | |
| expect(senderTransfersHistory).not.toContain(transferRequest); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment