mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-25 00:54:05 +01:00
test(channelserver): add handler coverage tests for misc, cafe, festa, event
Add four new test files covering previously-untested handler functions to raise total coverage from 57.7% to 60.0%: - handlers_misc_coverage_test.go: minidata, trend weapons, etc points, equip skin history - handlers_cafe_coverage_test.go: cafe duration bonuses, daily cafe, cafe duration - handlers_festa_coverage_test.go: mezfes data, festa voting, entry, charge, prizes, state queries, member enumeration - handlers_event_coverage_test.go: weekly schedule, login boost, scenario data, friends/blacklist operations Also make mockCharacterRepo.ReadEtcPoints configurable to support etc points handler tests.
This commit is contained in:
@@ -121,6 +121,12 @@ type mockCharacterRepo struct {
|
||||
loadSaveDataNew bool
|
||||
loadSaveDataName string
|
||||
loadSaveDataErr error
|
||||
|
||||
// ReadEtcPoints mock fields
|
||||
etcBonusQuests uint32
|
||||
etcDailyQuests uint32
|
||||
etcPromoPoints uint32
|
||||
etcPointsErr error
|
||||
}
|
||||
|
||||
func newMockCharacterRepo() *mockCharacterRepo {
|
||||
@@ -205,7 +211,7 @@ func (m *mockCharacterRepo) SetDeleted(_ uint32) error
|
||||
func (m *mockCharacterRepo) UpdateDailyCafe(_ uint32, _ time.Time, _, _ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ResetDailyQuests(_ uint32) error { return nil }
|
||||
func (m *mockCharacterRepo) ReadEtcPoints(_ uint32) (uint32, uint32, uint32, error) {
|
||||
return 0, 0, 0, nil
|
||||
return m.etcBonusQuests, m.etcDailyQuests, m.etcPromoPoints, m.etcPointsErr
|
||||
}
|
||||
func (m *mockCharacterRepo) ResetCafeTime(_ uint32, _ time.Time) error { return nil }
|
||||
func (m *mockCharacterRepo) UpdateGuildPostChecked(_ uint32) error { return nil }
|
||||
|
||||
Reference in New Issue
Block a user