-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgoartists_test.go
63 lines (49 loc) · 1.79 KB
/
goartists_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package goartists
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSearchArtirstByName(t *testing.T) {
service := NewService("123") // Yes, they accept any number
t.Run("should be able return artist by name", func(t *testing.T) {
_, err := service.SearchArtirstByName("Megadeth")
assert.Nil(t, err)
})
t.Run("should be able return error passing invalid artist name", func(t *testing.T) {
_, err := service.SearchArtirstByName("ashdiausdiansd")
assert.NotNil(t, err)
})
}
func TestSearchArtistByID(t *testing.T) {
service := NewService("123") // Yes, they accept any number
t.Run("should be able return artist by name", func(t *testing.T) {
_, err := service.SearchArtistByID("1489562")
assert.Nil(t, err)
})
t.Run("should be able return error passing invalid artist id", func(t *testing.T) {
_, err := service.SearchArtistByID("0000")
assert.NotNil(t, err)
})
}
func TestSearchArtistByFacebookPageID(t *testing.T) {
service := NewService("123") // Yes, they accept any number
t.Run("should be able return artist by facebook page id", func(t *testing.T) {
_, err := service.SearchArtistByFacebookPageID("7709052329")
assert.Nil(t, err)
})
t.Run("should be able return error passing invalid artist facebook page id", func(t *testing.T) {
_, err := service.SearchArtistByFacebookPageID("0000")
assert.NotNil(t, err)
})
}
func TestGetEventsByArtistName(t *testing.T) {
service := NewService("123") // Yes, they accept any number
t.Run("should be able return artist events by name", func(t *testing.T) {
_, err := service.GetEventsByArtistName("Megadeth")
assert.Nil(t, err)
})
t.Run("should be able return error passing invalid artist name", func(t *testing.T) {
_, err := service.GetEventsByArtistName("ashdiausdiansd")
assert.NotNil(t, err)
})
}