Created
December 27, 2017 15:09
-
-
Save caalberts/d113c50270497d3723aad352578936c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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