mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-26 17:43:21 +01:00
refactor(channelserver): consolidate tests into matching source test files
Move ~300 test functions from 21 catch-all files (handlers_core_test.go, handlers_coverage*_test.go, *_coverage_test.go) into the *_test.go file matching each handler's source file. This makes tests discoverable by convention: tests for handlers_guild.go live in handlers_guild_test.go. New files: handlers_guild_mission_test.go, sys_time_test.go. No test logic changed — pure file reorganization.
This commit is contained in:
@@ -782,3 +782,36 @@ func TestHandleMsgSysGetFile_ExistingQuestFile(t *testing.T) {
|
||||
t.Errorf("expected success ack (ErrorCode=0) for existing quest file, got ErrorCode=%d", errorCode)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleMsgMhfLoadFavoriteQuest(t *testing.T) {
|
||||
server := createMockServer()
|
||||
server.charRepo = newMockCharacterRepo()
|
||||
session := createMockSession(100, server)
|
||||
|
||||
pkt := &mhfpacket.MsgMhfLoadFavoriteQuest{AckHandle: 1}
|
||||
handleMsgMhfLoadFavoriteQuest(session, pkt)
|
||||
|
||||
select {
|
||||
case <-session.sendPackets:
|
||||
default:
|
||||
t.Error("expected response")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHandleMsgMhfSaveFavoriteQuest(t *testing.T) {
|
||||
server := createMockServer()
|
||||
server.charRepo = newMockCharacterRepo()
|
||||
session := createMockSession(100, server)
|
||||
|
||||
pkt := &mhfpacket.MsgMhfSaveFavoriteQuest{
|
||||
AckHandle: 1,
|
||||
Data: []byte{0x01, 0x00, 0x01, 0x00, 0x01},
|
||||
}
|
||||
handleMsgMhfSaveFavoriteQuest(session, pkt)
|
||||
|
||||
select {
|
||||
case <-session.sendPackets:
|
||||
default:
|
||||
t.Error("expected response")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user