ajout de prix pour les Part
This commit is contained in:
@@ -95,99 +95,6 @@ public class test_V2 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void test_isComplete(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TM5);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertTrue(config1.isComplete());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isNotComplete(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TM5);
|
||||
config1.selectPart(XS);
|
||||
|
||||
assertFalse(config1.isComplete());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isNotComplete_empty_cm(){
|
||||
CompatibilityManager cm2 = new CompatibilityManagerImpl();
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm2);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TM5);
|
||||
config1.selectPart(XS);
|
||||
|
||||
assertFalse(config1.isComplete());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isValide_empty_cm(){
|
||||
CompatibilityManager cm2 = new CompatibilityManagerImpl();
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm2);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TM5);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isValide1(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_isValide2(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
config1.selectPart(TS6);
|
||||
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isNotValide1(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG100);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertFalse(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isNotValide2(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(XS);
|
||||
|
||||
assertFalse(config1.isValid());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_Property(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
@@ -213,4 +120,21 @@ public class test_V2 {
|
||||
assertTrue(config1.getPart(exterior).getProperty("color").isEmpty());
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_Price(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
assertTrue(((PartImpl)config1.getPart(engine)).getPrice()==25000);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_Config_Price(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
assertTrue(config1.getTotalPrice()==52500);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user