This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
go-discogs/artists_test.go

27 lines
780 B
Go
Raw Normal View History

2016-03-10 14:48:15 +00:00
package discogs
import (
"fmt"
"testing"
)
func TestArtistService_Artist(t *testing.T) {
expectedId := 1000
2017-02-14 19:01:50 +00:00
d := NewClient(testUserAgent, testToken)
2016-03-10 14:48:15 +00:00
artist, _, err := d.Artist.Artist(&ArtistParams{Artist_id: "1000"})
check(t, err)
assert(t, artist.Id == expectedId, fmt.Sprintf("Release.Title looked for %s, and received %s ", expectedId, artist.Id))
}
2016-03-11 14:07:35 +00:00
func TestArtistService_Releases(t *testing.T) {
expectedArtist := "Dave Clarke"
2017-02-14 19:01:50 +00:00
d := NewClient(testUserAgent, testToken)
2016-03-11 14:07:35 +00:00
releases, _, err := d.Artist.Releases(&ArtistParams{Artist_id: "1000", Sort: "year", Sort_order: "desc"})
check(t, err)
assert(t, releases.Releases[0].Artist == expectedArtist, fmt.Sprintf("Releses.Artist looked for %s, and received %s ", expectedArtist, releases.Releases[0].Artist))
}