Skip to content

Instantly share code, notes, and snippets.

@caalberts
Created December 27, 2017 15:09
Show Gist options
  • Save caalberts/d113c50270497d3723aad352578936c0 to your computer and use it in GitHub Desktop.
Save caalberts/d113c50270497d3723aad352578936c0 to your computer and use it in GitHub Desktop.
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
type stubRedis struct {
data map[string]string
err error
}
func (stub *stubRedis) HGetAll(key string) (map[string]string, error) {
return stub.data, nil
}
func (stub *stubRedis) HMSet(key string, data map[string]interface{}) (string, error) {
for k, v := range data {
stub.data[k] = v.(string)
}
return "", nil
}
const id = "abcd1234"
var fakeData = map[string]string{
"Id": id,
"Name": "John Doe",
"Balance": "100",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment