mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
32 lines
672 B
Go
32 lines
672 B
Go
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
package model
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestStatus(t *testing.T) {
|
|
status := Status{NewId(), STATUS_ONLINE, true, 0, ""}
|
|
json := status.ToJson()
|
|
status2 := StatusFromJson(strings.NewReader(json))
|
|
|
|
if status.UserId != status2.UserId {
|
|
t.Fatal("UserId should have matched")
|
|
}
|
|
|
|
if status.Status != status2.Status {
|
|
t.Fatal("Status should have matched")
|
|
}
|
|
|
|
if status.LastActivityAt != status2.LastActivityAt {
|
|
t.Fatal("LastActivityAt should have matched")
|
|
}
|
|
|
|
if status.Manual != status2.Manual {
|
|
t.Fatal("Manual should have matched")
|
|
}
|
|
}
|