2015-06-26 20:07:46 +00:00
|
|
|
package gomdb
|
2015-06-26 17:36:33 +00:00
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestImdbSearchMovies(t *testing.T) {
|
2015-07-17 20:16:57 +00:00
|
|
|
resp, err := Search("Fight Club", "1999")
|
2015-06-26 17:36:33 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Error("Failed Search Movies")
|
|
|
|
}
|
|
|
|
if resp.Search[0].Title != "Fight Club" {
|
|
|
|
t.Error("Wrong Movie")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestImdbGetMovieByTitle(t *testing.T) {
|
2015-07-17 20:16:57 +00:00
|
|
|
resp, err := MovieByTitle("Fight Club", "1999")
|
2015-06-26 17:36:33 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Error("Failed GetMovieByTitle")
|
|
|
|
}
|
|
|
|
if resp.Title != "Fight Club" {
|
|
|
|
t.Error("Wrong Movie")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestImdbGetMovieByImdbID(t *testing.T) {
|
2015-07-17 20:16:57 +00:00
|
|
|
resp, err := MovieByImdbID("tt0137523")
|
2015-06-26 17:36:33 +00:00
|
|
|
if err != nil {
|
|
|
|
t.Error("Failed GetMovieByImdbID")
|
|
|
|
}
|
|
|
|
if resp.Title != "Fight Club" {
|
|
|
|
t.Error("Wrong Movie")
|
|
|
|
}
|
|
|
|
}
|