diff --git a/src/utils/json_test.go b/src/utils/json_test.go new file mode 100644 index 0000000..81a9b3d --- /dev/null +++ b/src/utils/json_test.go @@ -0,0 +1,25 @@ + +package utils + +import ( + "testing" + "github.com/stretchr/testify/assert" +) + +func TestJsonGetInt64WithString(t *testing.T) { + + n := JsonGetInt64("test") + assert.Equal(t, int64(0), n) +} + +func TestJsonGetInt64WithInt(t *testing.T) { + + n := JsonGetInt64(1234) + assert.Equal(t, int64(0), n) +} + +func TestJsonGetInt64WithFloat64(t *testing.T) { + + n := JsonGetInt64(float64(1234)) + assert.Equal(t, int64(1234), n) +}