Advertisement
techno-

PeliculaTest

Nov 4th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.53 KB | None | 0 0
  1. package e1;
  2.  
  3. import org.junit.jupiter.api.AfterEach;
  4. import org.junit.jupiter.api.BeforeAll;
  5. import org.junit.jupiter.api.BeforeEach;
  6. import org.junit.jupiter.api.Test;
  7.  
  8. import static org.junit.jupiter.api.Assertions.*;
  9.  
  10. class PeliculaTest {
  11.  
  12.     private static Pelicula p1;
  13.     @BeforeAll
  14.     static void meterDatos() {
  15.         p1 =  new Pelicula("Minions", 1500000.0f);
  16.         Especialista esp = new Especialista("Carlo", "Ancelotti", "77777777A", 666666666, "italiano", true, 50);
  17.         Interprete inter = new Interprete("Fede", "Valverde", "77777777A", 666666666, "uruguayo", true, 40);
  18.         Interprete inter2 = new Interprete("Luka", "Modric", "77777777A", 666666666, "croata", false, 60);
  19.         Doblador dob = new Doblador("Tony", "Kroos", "77777891A", 666666666, "alemán", 50);
  20.         Director dir = new Director("Karim", "Benzema", "77777777A", 666666666, "francés", 13, 100);
  21.         Productores prod = new Productores("Rodrygo", "Goes", "77777777A", 666666666, "brasileño", 80);
  22.         Musico mus = new Musico("Vinicius", "Junior", "77777777A", 666666666, "brasileño", 90);
  23.         Guionista gui = new Guionista("Marco", "Asensio", "77777777A", 666666666, "español", true, 70);
  24.  
  25.         p1.insertarHumano(esp);
  26.         p1.insertarHumano(inter);
  27.         p1.insertarHumano(inter2);
  28.         p1.insertarHumano(dob);
  29.         p1.insertarHumano(dir);
  30.         p1.insertarHumano(prod);
  31.         p1.insertarHumano(mus);
  32.         p1.insertarHumano(gui);
  33.     }
  34.  
  35.     @Test
  36.     void printSalaries() {
  37.         String texto="\nCarlo Ancelotti (Stunt performer with extra for danger): 3000.0 euro\n" +
  38.                 "Fede Valverde (Actor protagonist): 24000.0 euro\n" +
  39.                 "Luka Modric (Actor secondary): 12000.0 euro\n" +
  40.                 "Tony Kroos (Dubber): 1000.0 euro\n" +
  41.                 "Karim Benzema (Director, 13 years of experiencie): 23000.0 euro\n" +
  42.                 "Rodrygo Goes (Producer): 7200.0 euro\n" +
  43.                 "Vinicius Junior (Musician): 5400.0 euro\n" +
  44.                 "Marco Asensio (Screenwriter, original screenplay): 8900.0 euro\n" +
  45.                 "The total payroll for Minions is 84500.0 euro";
  46.         assertEquals(texto,p1.printSalaries());
  47.     }
  48.  
  49.     @Test
  50.     void printRoyalties() {
  51.         String texto="\nKarim Benzema (Director): 75000.0\n" +
  52.                 "Rodrygo Goes (Producer): 30000.0\n" +
  53.                 "Vinicius Junior (Musician): 60000.0\n" +
  54.                 "Marco Asensio (Screenwriter): 75000.0";
  55.         assertEquals(texto,p1.printRoyalties());
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement