-
Notifications
You must be signed in to change notification settings - Fork 0
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
19 changed files
with
253 additions
and
89 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
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
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
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
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
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
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
29 changes: 29 additions & 0 deletions
29
...t/src/main/kotlin/net/averak/gsync/testkit/fixture/builder/master/FriendSettingBuilder.kt
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,29 @@ | ||
package net.averak.gsync.testkit.fixture.builder.master | ||
|
||
import net.averak.gsync.domain.model.FriendSetting | ||
|
||
class FriendSettingBuilder( | ||
private var data: FriendSetting, | ||
) { | ||
|
||
constructor() : this( | ||
FriendSetting( | ||
maxFriendCount = 100, | ||
maxFriendRequestCount = 100, | ||
), | ||
) | ||
|
||
fun maxFriendCount(maxFriendCount: Int): FriendSettingBuilder { | ||
data = data.copy(maxFriendCount = maxFriendCount) | ||
return this | ||
} | ||
|
||
fun maxFriendRequestCount(maxFriendRequestCount: Int): FriendSettingBuilder { | ||
data = data.copy(maxFriendRequestCount = maxFriendRequestCount) | ||
return this | ||
} | ||
|
||
fun build(): Registry { | ||
return Registry(friendSetting = data) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
testkit/src/main/kotlin/net/averak/gsync/testkit/fixture/builder/master/Registry.kt
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,7 @@ | ||
package net.averak.gsync.testkit.fixture.builder.master | ||
|
||
import net.averak.gsync.domain.model.FriendSetting | ||
|
||
data class Registry( | ||
val friendSetting: FriendSetting? = null, | ||
) |
33 changes: 33 additions & 0 deletions
33
testkit/src/main/kotlin/net/averak/gsync/testkit/fixture/builder/player/PlayerBuilder.kt
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,33 @@ | ||
package net.averak.gsync.testkit.fixture.builder.player | ||
|
||
import net.averak.gsync.domain.model.Player | ||
import net.averak.gsync.domain.model.PlayerProfile | ||
import net.averak.gsync.testkit.Faker | ||
import java.util.* | ||
|
||
class PlayerBuilder( | ||
private var data: Player, | ||
) { | ||
|
||
constructor(playerID: UUID) : this( | ||
Player( | ||
id = playerID, | ||
friendID = UUID.randomUUID(), | ||
isBanned = false, | ||
profile = PlayerProfile( | ||
nickname = Faker.alphanumeric(10), | ||
iconID = Faker.uuidv4().toString(), | ||
), | ||
login = null, | ||
), | ||
) | ||
|
||
fun profile(profile: PlayerProfile): PlayerBuilder { | ||
data = data.copy(profile = profile) | ||
return this | ||
} | ||
|
||
fun build(): Registry { | ||
return Registry(player = data) | ||
} | ||
} |
Oops, something went wrong.