-
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.
Merge pull request #135 from averak/feature/130-make-testfixture-with…
…-builder テストフィクスチャをbuilder経由で作成する
- Loading branch information
Showing
21 changed files
with
263 additions
and
99 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
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, | ||
) |
Oops, something went wrong.