How to test apps that uses this wrapper?
I'm happy if documents exist or an official interface and mock implementations are provided.
Now I define my own interface and inject mock like following.
// example
type SpotifyClient interface {
GetTracks(ids ...spotify.ID) ([]*spotify.FullTrack, error)
...
}
// in test code
type mockSpotifyClient struct {}
func (c *mockSpotifyClient) GetTracks(ids ...spotify.ID) ([]*spotify.FullTrack, error) {
...
}
How to test apps that uses this wrapper? I'm happy if documents exist or an official interface and mock implementations are provided. Now I define my own interface and inject mock like following.