Files
Erupe/server/channelserver/handlers_guild_mission_test.go
Houmgaor d0837e779c 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.
2026-02-26 23:41:44 +01:00

100 lines
2.0 KiB
Go

package channelserver
import (
"testing"
"erupe-ce/network/mhfpacket"
)
// --- Guild mission handler tests ---
func TestHandleMsgMhfAddGuildMissionCount(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
handleMsgMhfAddGuildMissionCount(session, &mhfpacket.MsgMhfAddGuildMissionCount{
AckHandle: 1,
})
select {
case p := <-session.sendPackets:
if len(p.data) == 0 {
t.Error("response should have data")
}
default:
t.Error("no response queued")
}
}
func TestHandleMsgMhfSetGuildMissionTarget(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
handleMsgMhfSetGuildMissionTarget(session, &mhfpacket.MsgMhfSetGuildMissionTarget{
AckHandle: 1,
})
select {
case p := <-session.sendPackets:
if len(p.data) == 0 {
t.Error("response should have data")
}
default:
t.Error("no response queued")
}
}
func TestHandleMsgMhfCancelGuildMissionTarget(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
handleMsgMhfCancelGuildMissionTarget(session, &mhfpacket.MsgMhfCancelGuildMissionTarget{
AckHandle: 1,
})
select {
case p := <-session.sendPackets:
if len(p.data) == 0 {
t.Error("response should have data")
}
default:
t.Error("no response queued")
}
}
func TestHandleMsgMhfGetGuildMissionRecord(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
handleMsgMhfGetGuildMissionRecord(session, &mhfpacket.MsgMhfGetGuildMissionRecord{
AckHandle: 1,
})
select {
case p := <-session.sendPackets:
if len(p.data) == 0 {
t.Error("response should have data")
}
default:
t.Error("no response queued")
}
}
func TestHandleMsgMhfGetGuildMissionList(t *testing.T) {
server := createMockServer()
session := createMockSession(1, server)
handleMsgMhfGetGuildMissionList(session, &mhfpacket.MsgMhfGetGuildMissionList{
AckHandle: 1,
})
select {
case p := <-session.sendPackets:
if len(p.data) == 0 {
t.Error("response should have data")
}
default:
t.Error("no response queued")
}
}