require File.dirname(__FILE__) + '/../test_helper' 
class MovieServiceGetShowtimesByTheatreTestCase < Test::Unit::TestCase 
  def test_get_showtimes 
    result = MoviesServiceClient.get_movie_showtimes_by_theatre(7)
    assert result.class == Array, "Wynik nie jest tablic" 
    assert result.size > 0, "Metoda nie zwrcia adnych danych" 
    for by_movie in result 
      assert by_movie.class == Logical::MovieShowtimes, 
         "Elementy tablicy wynikowej nie s obiektami klasy MovieShowtimes" 
      assert by_movie.movie.class == Logical::Movie, 
         "Atrybut movie nie jest obiektem klasy Movie" 
      RAILS_DEFAULT_LOGGER.debug("Klasa: #{bLmovie.showtimes.class}") 
      assert by_movie.showtimes.class == Array, "Atrybut showtimes nie jest tablic"
      assert by_movie.showtimes.size > 0, "Atrybut showtimes jest pust tablic " 

      for showtime in by_movie.showtimes do 
        assert showtime.class == Logical::Showtime, 
          "Atrybut showtime nie jest obiektem klasy Showtime" 
      end
    end
  end
end

