MCPcopy Create free account
hub / github.com/chanify/chanify / TestMessageChannel

Function TestMessageChannel

model/message_test.go:73–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestMessageChannel(t *testing.T) {
74 tk := &Token{}
75 m := NewMessage(tk)
76 if len(m.Channel) > 0 {
77 t.Fatal("Check channel failed")
78 }
79 m.fixChannel()
80 if !bytes.Equal(m.Channel, defaultChannel) {
81 t.Fatal("Check default channel failed")
82 }
83 m = NewMessage(tk)
84 m.TimelineContent("test", "", nil, []*MsgTimeItem{{Name: "123", Value: "123"}})
85 if len(m.Channel) > 0 {
86 t.Fatal("Check timeline channel failed")
87 }
88 m.fixChannel()
89 if !bytes.Equal(m.Channel, timelineChannel) {
90 t.Fatal("Check default timeline channel failed")
91 }
92}

Callers

nothing calls this directly

Calls 3

fixChannelMethod · 0.95
TimelineContentMethod · 0.95
NewMessageFunction · 0.85

Tested by

no test coverage detected