Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lp2.lab06;
- import org.junit.Assert;
- import org.junit.Before;
- import org.junit.Test;
- public class MinhaCDtecaTest {
- CD cd1 = null;
- CD cd2 = null;
- CD cd3 = null;
- CD cd4 = null;
- @Before
- public void criaCDtecas(){
- criaCDs();
- MinhaCDteca colec1 = new MinhaCDteca();
- colec1.adicionaCD(cd1);
- colec1.adicionaCD(cd2);
- colec1.adicionaCD(cd3);
- MinhaCDteca colec2 = new MinhaCDteca();
- colec2.adicionaCD(cd1);
- colec2.adicionaCD(cd3);
- MinhaCDteca colec3 = new MinhaCDteca();
- colec3.adicionaCD(cd2);
- colec3.adicionaCD(cd4);
- MinhaCDteca colec4 = new MinhaCDteca();
- colec4.adicionaCD(cd1);
- colec4.adicionaCD(cd3);
- }
- private void criaCDs(){
- cd1 = new CD("CD 01", "Cantor tal");
- cd2 = new CD("CD 02", "Cantora tal", 21);
- cd3 = new CD("CD 03", "Ivete");
- cd4 = new CD("CD 04", "Joelma", 15);
- try{
- cd1.cadastraFaixa("Faixa 0");
- }catch(Exception e){
- System.err.print(e);
- }
- try{
- cd1.cadastraFaixa("Faixa 1");
- }catch(Exception e){
- System.err.print(e);
- }
- try{
- cd3.cadastraFaixa("Alegria");
- }catch(Exception e){
- System.err.print(e);
- }
- try{
- cd1.mudaMusicaPrincipal("Faixa 1");
- }catch(Exception e){
- System.err.print(e);
- }
- try{
- cd3.mudaMusicaPrincipal("Alegria");
- }catch(Exception e){
- System.err.print(e);
- }
- }
- @Test
- public void test() {
- System.out.println(nova + "fim");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement