mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 18:12:50 +01:00
refactor(test): consolidate two GuildRepo mocks into one
mockGuildRepoForMail and mockGuildRepoOps each implemented different subsets of the 68-method GuildRepo interface. Adding any new method required updating both mocks. Merged into a single mockGuildRepo with configurable struct fields for error injection and no-op defaults for the rest.
This commit is contained in:
@@ -427,7 +427,7 @@ func TestHandleMsgMhfSendMail_Direct(t *testing.T) {
|
||||
func TestHandleMsgMhfSendMail_Guild(t *testing.T) {
|
||||
server := createMockServer()
|
||||
mailMock := &mockMailRepo{}
|
||||
guildMock := &mockGuildRepoForMail{
|
||||
guildMock := &mockGuildRepo{
|
||||
guild: &Guild{ID: 10},
|
||||
members: []*GuildMember{
|
||||
{CharID: 100},
|
||||
@@ -469,7 +469,7 @@ func TestHandleMsgMhfSendMail_Guild(t *testing.T) {
|
||||
func TestHandleMsgMhfSendMail_GuildNotFound(t *testing.T) {
|
||||
server := createMockServer()
|
||||
mailMock := &mockMailRepo{}
|
||||
guildMock := &mockGuildRepoForMail{getErr: errNotFound}
|
||||
guildMock := &mockGuildRepo{getErr: errNotFound}
|
||||
server.mailRepo = mailMock
|
||||
server.guildRepo = guildMock
|
||||
ensureMailService(server)
|
||||
|
||||
Reference in New Issue
Block a user