Files
mattermost/model/message_test.go
2015-10-08 12:27:09 -04:00

25 lines
500 B
Go

// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
import (
"strings"
"testing"
)
func TestMessgaeJson(t *testing.T) {
m := NewMessage(NewId(), NewId(), NewId(), ACTION_TYPING)
m.Add("RootId", NewId())
json := m.ToJson()
result := MessageFromJson(strings.NewReader(json))
if m.TeamId != result.TeamId {
t.Fatal("Ids do not match")
}
if m.Props["RootId"] != result.Props["RootId"] {
t.Fatal("Ids do not match")
}
}