Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package testare;
- import static org.junit.jupiter.api.Assertions.*;
- import org.junit.jupiter.api.Test;
- import model.Angajat;
- import model.Categorie;
- import model.Client;
- import model.Comanda;
- import model.Produs;
- import model.StareClient;
- class TestareAngajat {
- @Test
- void testVerifica_raport_cumparator() {
- // Client c1= new Client ("user1","parola1","user1@yahoo.com","adr1",suma,nrvizite,stare);
- Produs[] produsArray1 = new Produs[2];
- Produs[] produsArray2 = new Produs[1];
- Produs p1 = new Produs("produs1",15,Categorie.cosmetice,4);
- Produs p2 = new Produs("produs2",10,Categorie.electronice,5);
- Produs p3 = new Produs("produs2",10,Categorie.electronice,5);
- produsArray1[0] = p1;
- produsArray1[1] = p2;
- produsArray2[0] = p3;
- Comanda[] comandaArray1 = new Comanda[2];
- Comanda com1= new Comanda(9,25,produsArray1);
- Comanda com2= new Comanda(5,10,produsArray2);
- comandaArray1[0] = com1;
- comandaArray1[1] = com2;
- //teste bune
- Client[] clientArray1 = new Client[4];
- Client[] clientArray2 = new Client[4];
- Client[] clientArray3 = new Client[4];
- int i;
- Client c1= new Client ("user1","parola1","user1@yahoo.com","adr1",0,0,StareClient.Blocat, comandaArray1);
- Client c2= new Client ("user2","parola2","user2@yahoo.com","adr2",0,5,StareClient.Blocat);
- Client c3= new Client ("user3","parola3","user3@yahoo.com","adr3",5,0,StareClient.Inactiv);
- Client c4= new Client ("user4","parola4","user4@yahoo.com","adr4",7,3,StareClient.Activ);
- clientArray1[0] = c1;
- clientArray1[1] = c2;
- clientArray1[2] = c3;
- clientArray1[3] = c4;
- Angajat a1=new Angajat("nume1", "id1", Categorie.lactate, 1, clientArray1);
- // Angajat a2=new Angajat("nume2", "id2", Categorie.mezeluri, 1, clientArray2);
- // Angajat a3=new Angajat("nume3", "id3", Categorie.electronice, 1, clientArray3);
- // Angajat a1=new Angajat("nume1", "id1", Categorie.lactate, 1);
- // Angajat a2=new Angajat("nume2", "id2", Categorie.mezeluri, 1);
- // Angajat a3=new Angajat("nume3", "id3", Categorie.electronice, 1);
- assertTrue(a1.verifica_raport_cumparator(c1));
- assertTrue(a1.verifica_raport_cumparator(c2));
- assertTrue(a1.verifica_raport_cumparator(c3));
- assertTrue(a1.verifica_raport_cumparator(c4));
- Client c5= new Client ("user5","parola5","user5@yahoo.com","adr5",0,10,StareClient.Fidel);
- Client c6= new Client ("user6","parola6","user6@yahoo.com","adr6",10,12,StareClient.Fidel);
- //teste proaste
- Client c7= new Client ("user7","parola7","user7@yahoo.com","adr7",3,3,StareClient.Blocat);
- Client c8= new Client ("user8","parola8","user8@yahoo.com","adr8",15,4,StareClient.Inactiv);
- clientArray1[0] = c5;
- clientArray1[1] = c6;
- clientArray1[2] = c7;
- clientArray1[3] = c8;
- assertTrue(a1.verifica_raport_cumparator(c5));
- assertTrue(a1.verifica_raport_cumparator(c6));
- assertFalse(a1.verifica_raport_cumparator(c7));
- assertFalse(a1.verifica_raport_cumparator(c8));
- Client c9= new Client ("user9","parola9","user9@yahoo.com","adr9",3,10,StareClient.Activ);
- Client c10= new Client ("user10","parola10","user10@yahoo.com","adr10",0,5,StareClient.Activ);
- Client c11= new Client ("user11","parola11","user11@yahoo.com","adr11",7,9,StareClient.Fidel);
- Client c12= new Client ("user12","parola12","user12@yahoo.com","adr12",0,9,StareClient.Fidel);
- clientArray1[0] = c9;
- clientArray1[1] = c10;
- clientArray1[2] = c11;
- clientArray1[3] = c12;
- assertFalse(a1.verifica_raport_cumparator(c9));
- assertFalse(a1.verifica_raport_cumparator(c10));
- assertFalse(a1.verifica_raport_cumparator(c11));
- assertFalse(a1.verifica_raport_cumparator(c12));
- // fail("Not yet implemented");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement