-
Notifications
You must be signed in to change notification settings - Fork 122
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
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
src/test/java/com/faforever/client/builders/LeagueScoreJournalBeanBuilder.java
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 |
---|---|---|
@@ -1,4 +1,69 @@ | ||
package com.faforever.client.builders; | ||
|
||
import com.faforever.client.domain.LeagueScoreJournalBean; | ||
import com.faforever.client.domain.LeagueSeasonBean; | ||
import com.faforever.client.domain.SubdivisionBean; | ||
|
||
public class LeagueScoreJournalBeanBuilder { | ||
public static LeagueScoreJournalBeanBuilder create() { | ||
return new LeagueScoreJournalBeanBuilder(); | ||
} | ||
|
||
private final LeagueScoreJournalBean leagueScoreJournalBean = new LeagueScoreJournalBean(); | ||
|
||
public LeagueScoreJournalBeanBuilder defaultValues() { | ||
gameId(1); | ||
loginId(100); | ||
gameCount(11); | ||
scoreBefore(5); | ||
scoreAfter(6); | ||
season(LeagueSeasonBeanBuilder.create().defaultValues().get()); | ||
divisionBefore(SubdivisionBeanBuilder.create().defaultValues().get()); | ||
divisionAfter(SubdivisionBeanBuilder.create().defaultValues().get()); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder gameId(int gameId) { | ||
leagueScoreJournalBean.setGameId(gameId); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder loginId(int loginId) { | ||
leagueScoreJournalBean.setLoginId(loginId); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder gameCount(int gameCount) { | ||
leagueScoreJournalBean.setGameCount(gameCount); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder scoreBefore(int scoreBefore) { | ||
leagueScoreJournalBean.setScoreBefore(scoreBefore); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder scoreAfter(int scoreAfter) { | ||
leagueScoreJournalBean.setScoreAfter(scoreAfter); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder season(LeagueSeasonBean season) { | ||
leagueScoreJournalBean.setSeason(season); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder divisionBefore(SubdivisionBean divisionBefore) { | ||
leagueScoreJournalBean.setDivisionBefore(divisionBefore); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBeanBuilder divisionAfter(SubdivisionBean divisionAfter) { | ||
leagueScoreJournalBean.setDivisionAfter(divisionAfter); | ||
return this; | ||
} | ||
|
||
public LeagueScoreJournalBean get() { | ||
return leagueScoreJournalBean; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/test/java/com/faforever/client/builders/LeagueScoresListBuilder.java
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,34 @@ | ||
package com.faforever.client.builders; | ||
|
||
import com.faforever.client.domain.LeagueScoreJournalBean; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class LeagueScoresListBuilder { | ||
private final List<LeagueScoreJournalBean> leagueScores = new ArrayList<>(); | ||
|
||
public static LeagueScoresListBuilder create() { | ||
return new LeagueScoresListBuilder(); | ||
} | ||
|
||
public LeagueScoresListBuilder defaultValues() { | ||
append(LeagueScoreJournalBeanBuilder.create().defaultValues().get()); | ||
return this; | ||
} | ||
|
||
public LeagueScoresListBuilder append(LeagueScoreJournalBean leagueScore) { | ||
leagueScores.add(leagueScore); | ||
return this; | ||
} | ||
|
||
public LeagueScoresListBuilder replace(List<LeagueScoreJournalBean> leagueScore) { | ||
this.leagueScores.clear(); | ||
this.leagueScores.addAll(leagueScore); | ||
return this; | ||
} | ||
|
||
public List<LeagueScoreJournalBean> get() { | ||
return leagueScores; | ||
} | ||
} |
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