Read me + 2 nouveaux tests dans la v1
This commit is contained in:
@@ -96,6 +96,19 @@ public class test_V2 {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_NotProperty(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertEquals(config1.getPart(exterior).getProperty("color").get(), "white");
|
||||
assertEquals(config1.getPart(interior).getProperty("color").get(), "black");
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_Property(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
@@ -106,7 +119,7 @@ public class test_V2 {
|
||||
|
||||
config1.getPart(exterior).setProperty("color","red");
|
||||
|
||||
assertTrue(config1.getPart(exterior).getProperty("color").get()=="red");
|
||||
assertEquals(config1.getPart(exterior).getProperty("color").get(), "red");
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@@ -120,27 +133,17 @@ public class test_V2 {
|
||||
|
||||
config1.getPart(exterior).setProperty("color","gsqgsdf");
|
||||
|
||||
assertTrue(config1.getPart(exterior).getProperty("color").get()=="gsqgsdf");
|
||||
assertEquals(config1.getPart(exterior).getProperty("color").get(), "gsqgsdf");
|
||||
assertFalse(config1.isValid());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_NotProperty(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertTrue(config1.getPart(exterior).getProperty("color").get()=="white");
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_Price(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
assertTrue(((PartImpl)config1.getPart(engine)).getPrice()==25000);
|
||||
assertEquals(((PartImpl)config1.getPart(engine)).getPrice(), 25000);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -150,7 +153,7 @@ public class test_V2 {
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
assertTrue(config1.getTotalPrice()==52500);
|
||||
assertEquals(config1.getTotalPrice(), 52500);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -158,7 +161,23 @@ public class test_V2 {
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
assertTrue(config1.getTotalPrice()==40000);
|
||||
assertEquals(config1.getTotalPrice(), 40000);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_Config_Price_No_Valid(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG100);
|
||||
config1.selectPart(TSF7);
|
||||
assertFalse(config1.isValid());
|
||||
assertEquals(config1.getTotalPrice(), -1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_Config_Price_Empty_config(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
assertTrue(config1.isValid());
|
||||
assertEquals(config1.getTotalPrice(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -175,12 +194,30 @@ public class test_V2 {
|
||||
|
||||
@Test
|
||||
void test_html2(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XC); //incompatible
|
||||
config1.selectPart(IS); //incompatible
|
||||
config1.getPart(exterior).setProperty("color", "red");
|
||||
config1.getPart(interior).setProperty("color", "red");
|
||||
try {
|
||||
HtmlGenerator.generateHTML(config1);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void test_html3(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TSF7);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
config1.getPart(exterior).setProperty("color", "red");
|
||||
config1.getPart(interior).setProperty("color", "red");
|
||||
try {
|
||||
HtmlGenerator.generateHTML(config1);
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user