4
0

map_test.go 324 B

1234567891011121314151617181920
  1. package stringvariables
  2. import (
  3. "github.com/stretchr/testify/assert"
  4. "testing"
  5. )
  6. func TestGetAndSet(t *testing.T) {
  7. Set("foo", "bar")
  8. Set("salutation", "hello")
  9. assert.Equal(t, "bar", Get("foo"))
  10. assert.Equal(t, "", Get("not exist"))
  11. }
  12. func TestGetall(t *testing.T) {
  13. ret := GetAll()
  14. assert.NotEmpty(t, ret)
  15. }