forked from pierront/mylibrary-template
création premier test
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
|||||||
|
package fr.iut_fbleau.but3.dev62.mylibrary.Orders.converter;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Orders;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
|
||||||
|
public class OrdersConverterTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void TestConvertOrdersToDomain(){
|
||||||
|
UUID uuid = UUID.randomUUID();
|
||||||
|
List<LigneCommande> listLigne = new ArrayList<>();
|
||||||
|
LigneCommande ligne = new LigneCommande("hp ecole ",12);
|
||||||
|
listLigne.add(ligne);
|
||||||
|
Comandeinfo commandeInfo = new ComandeInfo(uuid,listLigne);
|
||||||
|
AdresseInfo adressInfo = new AdresseInfo("rue du cheval","La Rochette","77000","France");
|
||||||
|
ModePaiement modePaiement = ModePaiement.CB;
|
||||||
|
|
||||||
|
Orders result = OrdersConverter.toDomain(commandeInfo,adressInfo,modePaiement);
|
||||||
|
|
||||||
|
|
||||||
|
assertNotNull(result);
|
||||||
|
assertEquals(result.clientId ,commandeInfo.clientId);
|
||||||
|
assertEquals(commandeInfo.lignesCommande(), result.lignesCommande());
|
||||||
|
assertEquals(result.rue , AdresseInfo.rue);
|
||||||
|
assertEquals(result.ville , AdresseInfo.ville);
|
||||||
|
assertEquals(result.codePostal , AdresseInfo.codePostal);
|
||||||
|
assertEquals(result.pays , AdresseInfo.pays);
|
||||||
|
assertEquals(result.modePaiement , modePaiement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user