diff --git a/src/fr/test/test.java b/src/fr/test/test.java index 9ab4826..b481ac2 100644 --- a/src/fr/test/test.java +++ b/src/fr/test/test.java @@ -5,6 +5,7 @@ import java.util.HashSet; import static org.junit.Assert.*; +import org.junit.Before; import org.junit.Test; import src.fr.impl.*; @@ -12,36 +13,40 @@ import src.fr.api.*; public class test { - public static void main(String[] args){ - Category Engine = new CategoryImpl("Engine"); - Category Transmission = new CategoryImpl("Transmission"); - Category Exterior= new CategoryImpl("Exterior"); - Category Interior= new CategoryImpl("Interior"); - //PartType - PartType EG100= new PartTypeImpl("EG100", Engine); - PartType EG133= new PartTypeImpl("EG133", Engine); - PartType EG210= new PartTypeImpl("EG210", Engine); - PartType ED110= new PartTypeImpl("ED110", Engine); - PartType ED180= new PartTypeImpl("ED180", Engine); - PartType EH120= new PartTypeImpl("EH120", Engine); + Category Engine = new CategoryImpl("Engine"); + Category Transmission = new CategoryImpl("Transmission"); + Category Exterior= new CategoryImpl("Exterior"); + Category Interior= new CategoryImpl("Interior"); - PartType TM5= new PartTypeImpl("TM5", Transmission); - PartType TM6= new PartTypeImpl("TM6", Transmission); - PartType TA5= new PartTypeImpl("TA5", Transmission); - PartType TS6= new PartTypeImpl("TS6", Transmission); - PartType TSF7= new PartTypeImpl("TSF7", Transmission); - PartType TC120= new PartTypeImpl("TC120", Transmission); + //PartType + PartType EG100= new PartTypeImpl("EG100", Engine); + PartType EG133= new PartTypeImpl("EG133", Engine); + PartType EG210= new PartTypeImpl("EG210", Engine); + PartType ED110= new PartTypeImpl("ED110", Engine); + PartType ED180= new PartTypeImpl("ED180", Engine); + PartType EH120= new PartTypeImpl("EH120", Engine); - PartType XC= new PartTypeImpl("XC", Exterior); - PartType XM= new PartTypeImpl("XM", Exterior); - PartType XS= new PartTypeImpl("XS", Exterior); + PartType TM5= new PartTypeImpl("TM5", Transmission); + PartType TM6= new PartTypeImpl("TM6", Transmission); + PartType TA5= new PartTypeImpl("TA5", Transmission); + PartType TS6= new PartTypeImpl("TS6", Transmission); + PartType TSF7= new PartTypeImpl("TSF7", Transmission); + PartType TC120= new PartTypeImpl("TC120", Transmission); - PartType IN= new PartTypeImpl("IN", Interior); - PartType IH= new PartTypeImpl("IH", Interior); - PartType IS= new PartTypeImpl("IS", Interior); + PartType XC= new PartTypeImpl("XC", Exterior); + PartType XM= new PartTypeImpl("XM", Exterior); + PartType XS= new PartTypeImpl("XS", Exterior); + + PartType IN= new PartTypeImpl("IN", Interior); + PartType IH= new PartTypeImpl("IH", Interior); + PartType IS= new PartTypeImpl("IS", Interior); + + CompatibilityManager cm = new CompatibilityManagerImpl(); + + @Before + public void init(){ - CompatibilityManager cm = new CompatibilityManagerImpl(); Set EH120Requirement = new HashSet(); EH120Requirement.add(TC120); @@ -91,13 +96,19 @@ public class test { } @Test - public void test(){ - assertTrue(true); + public void test_1_Incompatibilities(){ + assertTrue(cm.getIncompatibilities(EH120).contains(TC120)); } + @Test - public void test2(){ - assertEquals(1,1); //very Important test + public void test_multiple_Incompatibilities(){ + assertTrue( + cm.getIncompatibilities(TSF7).contains(EG100)&& + cm.getIncompatibilities(TSF7).contains(EG133)&& + cm.getIncompatibilities(TSF7).contains(ED110) + ); } + }