correction confif + Junit 5
This commit is contained in:
@@ -7,6 +7,8 @@ import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
import src.fr.impl.*;
|
||||
import src.fr.api.*;
|
||||
@@ -44,11 +46,6 @@ public class test {
|
||||
|
||||
CompatibilityManager cm = new CompatibilityManagerImpl();
|
||||
|
||||
PartType[] list = {EG100,EG133,EG210,ED110,ED180,EH120,TM5,TM6,TA5,TS6,TSF7,TC120,XC,XM,XS,IN,IH,IS};
|
||||
PartType[] listEn = {EG100,EG133,EG210,ED110,ED180,EH120};
|
||||
PartType[] listTr = {TM5,TM6,TA5,TS6,TSF7,TC120};
|
||||
PartType[] listEx = {XC,XM,XS};
|
||||
PartType[] listIn = {IN,IH,IS};
|
||||
|
||||
|
||||
@Before
|
||||
@@ -210,5 +207,61 @@ public class test {
|
||||
assertTrue(cm.getIncompatibilities(TSF7).contains(EG133));
|
||||
assertTrue(cm.getIncompatibilities(TSF7).contains(ED110));
|
||||
}
|
||||
|
||||
|
||||
@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_isValid_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_isValid(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TS6);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IS);
|
||||
|
||||
assertTrue(config1.isValid());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_isNotValid(){
|
||||
ConfigurationImpl config1 = new ConfigurationImpl(cm);
|
||||
config1.selectPart(EG210);
|
||||
config1.selectPart(TM5);
|
||||
config1.selectPart(XS);
|
||||
config1.selectPart(IH);
|
||||
|
||||
assertTrue(config1.isComplete());
|
||||
assertFalse(config1.isValid());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user