github.com/gigforks/mattermost-server@v4.9.1-0.20180619094218-800d97fa55d0+incompatible/model/switch_request_test.go (about) 1 // Copyright (c) 2017-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 TestSwitchRequestJson(t *testing.T) { 12 o := SwitchRequest{Email: NewId(), Password: NewId()} 13 json := o.ToJson() 14 ro := SwitchRequestFromJson(strings.NewReader(json)) 15 16 if o.Email != ro.Email { 17 t.Fatal("Emails do not match") 18 } 19 }