diff options
Diffstat (limited to 'model/channel_member_test.go')
-rw-r--r-- | model/channel_member_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/model/channel_member_test.go b/model/channel_member_test.go index e43560cee..6fb666300 100644 --- a/model/channel_member_test.go +++ b/model/channel_member_test.go @@ -69,3 +69,17 @@ func TestChannelMemberIsValid(t *testing.T) { t.Fatal(err) } } + +func TestChannelUnreadJson(t *testing.T) { + o := ChannelUnread{ChannelId: NewId(), TeamId: NewId(), MsgCount: 5, MentionCount: 3} + json := o.ToJson() + ro := ChannelUnreadFromJson(strings.NewReader(json)) + + if o.TeamId != ro.TeamId { + t.Fatal("Team Ids do not match") + } + + if o.MentionCount != ro.MentionCount { + t.Fatal("MentionCount do not match") + } +} |