add 2 helper methods for building KVPair(s)

This commit is contained in:
Anton Kaliaev
2017-11-30 11:17:35 -06:00
parent b89fd815a5
commit 20befcf6d6
2 changed files with 34 additions and 0 deletions

15
types/kvpair_test.go Normal file
View File

@ -0,0 +1,15 @@
package types
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestKVPairInt(t *testing.T) {
assert.Equal(t, KVPairInt("a", 1), &KVPair{Key: "a", ValueType: KVPair_INT, ValueInt: 1})
}
func TestKVPairString(t *testing.T) {
assert.Equal(t, KVPairString("a", "b"), &KVPair{Key: "a", ValueType: KVPair_STRING, ValueString: "b"})
}