github.com/gigforks/mattermost-server@v4.9.1-0.20180619094218-800d97fa55d0+incompatible/model/plugin_key_value_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 "testing" 8 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestPluginKeyIsValid(t *testing.T) { 13 kv := PluginKeyValue{PluginId: "someid", Key: "somekey", Value: []byte("somevalue")} 14 assert.Nil(t, kv.IsValid()) 15 16 kv.PluginId = "" 17 assert.NotNil(t, kv.IsValid()) 18 19 kv.PluginId = "someid" 20 kv.Key = "" 21 assert.NotNil(t, kv.IsValid()) 22 }