github.com/rajatvaryani/mattermost-server@v5.11.1+incompatible/model/system_test.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package model
     5  
     6  import (
     7  	"strings"
     8  	"testing"
     9  )
    10  
    11  func TestSystemJson(t *testing.T) {
    12  	system := System{Name: "test", Value: NewId()}
    13  	json := system.ToJson()
    14  	result := SystemFromJson(strings.NewReader(json))
    15  
    16  	if result.Name != "test" {
    17  		t.Fatal("Ids do not match")
    18  	}
    19  }