Этот коммит содержится в:
=Corey Hulen
2015-06-14 23:53:32 -08:00
Коммит cf7a05f80f
665 изменённых файлов: 129987 добавлений и 0 удалений

24
model/message_test.go Обычный файл
Просмотреть файл

@@ -0,0 +1,24 @@
// Copyright (c) 2015 Spinpunch, 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")
}
}