From 56e74239d6b34df8f30ef046f0b0ff4ff0866a71 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 14 Jun 2015 23:53:32 -0800 Subject: first commit --- model/message_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 model/message_test.go (limited to 'model/message_test.go') diff --git a/model/message_test.go b/model/message_test.go new file mode 100644 index 000000000..eb0c75193 --- /dev/null +++ b/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") + } +} -- cgit v1.2.3-1-g7c22