Last active
August 29, 2015 14:03
-
-
Save LordNairu/c28213824a673fff8a1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import static org.junit.Assert.*; | |
import org.junit.Before; | |
import org.junit.Test; | |
import cinema.Film; | |
public class testFilm { | |
public String filmTitle, filmDirector, filmProducer, productionCompany1, | |
productionCompany2, castMember1, castMember2, castMember3; | |
public Boolean is3D; | |
Film film, filmWithArgs; | |
@Before | |
public void setUp() throws Exception { | |
filmTitle = "title1"; | |
filmDirector = "director1"; | |
filmProducer = "producer1"; | |
productionCompany1 = "production1"; | |
productionCompany2 = "production2"; | |
castMember1 = "cast1"; | |
castMember2 = "cast2"; | |
castMember3 = "cast3"; | |
is3D = true; | |
film = new Film(); | |
} | |
@Test | |
public void testFilmObjectNotNull() { | |
if (!film.equals(null)) { | |
assertTrue(true); | |
} else { | |
assertTrue(false); | |
} | |
} | |
@Test | |
public void testFilmConstructorWithArgumentsWorking() { | |
filmWithArgs = new Film(filmTitle, filmDirector, filmProducer, | |
productionCompany1, productionCompany2, castMember1, | |
castMember2, castMember3, is3D); | |
if (filmWithArgs.getFilmTitle() == filmTitle | |
&& filmWithArgs.getFilmDirector() == filmDirector | |
&& filmWithArgs.getFilmProducer() == filmProducer | |
&& filmWithArgs.getProductionCompany1() == productionCompany1 | |
&& filmWithArgs.getProductionCompany2() == productionCompany2 | |
&& filmWithArgs.getCastMember1() == castMember1 | |
&& filmWithArgs.getCastMember2() == castMember2 | |
&& filmWithArgs.getCastMember3() == castMember3 | |
&& filmWithArgs.getIs3D() == is3D){ | |
assertTrue(true); | |
} else { | |
assertTrue(false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment