123456789101112131415161718192021222324252627 |
- package mb
- import (
- "testing"
- "github.com/stretchr/testify/assert"
- )
- func TestShouldBeEqualToArtist(t *testing.T) {
- m := NewMusicBrainz()
- s, _ := m.SearchForArtist("Metallica")
- name, _ := s.GetArtistName()
- assert.Equal(t, name, "Metallica")
- }
- func TestIfArtistIsValidThenErrIsNil(t *testing.T) {
- m := NewMusicBrainz()
- _, err := m.SearchForArtist("Metallica")
- assert.Nil(t, err, "err should be nil if found artist")
- }
- func TestErrShouldContainErrorIfArtistIsInvalid(t *testing.T) {
- m := NewMusicBrainz()
- _, err := m.SearchForArtist("asdfkjahsdflkjasdhfoia")
- assert.NotNil(t, err, "err should not be nil if found artist")
- }
|