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.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
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_gang_repository import MockGangRepository | ||
from tests.mocks.mock_outlaw_repository import MockOutlawRepository | ||
from thesheriff.application.gang.request.join_gang_request \ | ||
import JoinGangRequest | ||
from thesheriff.application.outlaw.join_gang import JoinGang | ||
from thesheriff.domain.gang.gang import Gang | ||
from thesheriff.domain.outlaw.outlaw import Outlaw | ||
|
||
|
||
def test_join_gangs(): | ||
gang_repository = MockGangRepository() | ||
outlaw_repository = MockOutlawRepository() | ||
|
||
previous_gang = Gang(1, "APreviousGang") | ||
gang_i_want_to_join = Gang(2, "TheWorstGang") | ||
gang_repository.add(gang_i_want_to_join) | ||
outlaw = Outlaw("VeryBadGuy", "iamabadguy@yopmail.com", 1) | ||
outlaw.gangs = [previous_gang] | ||
outlaw_repository.add(outlaw) | ||
|
||
request = JoinGangRequest(gang_i_want_to_join.id, outlaw.id) | ||
JoinGang(outlaw_repository, gang_repository).execute(request) | ||
|
||
assert len(outlaw.gangs) == 2 |