gomdb/gomdb_test.go
Christopher Herrera 2c12789f2c adding name change
2015-06-26 16:07:46 -04:00

34 lines
679 B
Go
Executable file

package gomdb
import "testing"
func TestImdbSearchMovies(t *testing.T) {
resp, err := SearchMovies("Fight Club", "1999")
if err != nil {
t.Error("Failed Search Movies")
}
if resp.Search[0].Title != "Fight Club" {
t.Error("Wrong Movie")
}
}
func TestImdbGetMovieByTitle(t *testing.T) {
resp, err := GetMovieByTitle("Fight Club", "1999")
if err != nil {
t.Error("Failed GetMovieByTitle")
}
if resp.Title != "Fight Club" {
t.Error("Wrong Movie")
}
}
func TestImdbGetMovieByImdbID(t *testing.T) {
resp, err := GetMovieByImdbID("tt0137523")
if err != nil {
t.Error("Failed GetMovieByImdbID")
}
if resp.Title != "Fight Club" {
t.Error("Wrong Movie")
}
}