This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invite friend minor fixes + added test case (#122)
- Loading branch information
Showing
6 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from tests.mocks.mock_mail_notifier import MockMailNotifier | ||
from tests.mocks.mock_outlaw_repository import MockOutlawRepository | ||
from thesheriff.application.outlaw.invite_friend import InviteFriend | ||
from thesheriff.application.outlaw.request.invite_friend_request import \ | ||
InviteFriendRequest | ||
from thesheriff.domain.outlaw.outlaw import Outlaw | ||
|
||
|
||
def test_invite_friend(): | ||
notifier = MockMailNotifier() | ||
outlaw_repository = MockOutlawRepository() | ||
|
||
outlaw = Outlaw("The gang chief", "bad@yopmail.com", 1) | ||
outlaw_repository.add(outlaw) | ||
|
||
receiver_email = "receiver@yopmail.com" | ||
|
||
invite_friend = InviteFriend(outlaw_repository, notifier) | ||
|
||
request = InviteFriendRequest(outlaw.id, receiver_email) | ||
mail = invite_friend.execute(request) | ||
|
||
assert mail.sender == outlaw.email | ||
assert mail.receiver == receiver_email |
This file contains 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