@@ -20,10 +20,11 @@ public class HtmlPrinterTest {
2020 Set .of (Weapon .Type .WEAPON ),
2121 Set .of (Weapon .Type .WEAPON , Weapon .Type .EQUIPMENT , Weapon .Type .SKILL , Weapon .Type .TURRET ));
2222 HtmlPrinter underTest ;
23- String fileName = "testFile" ;
23+ String fileName ;
2424 Sectorial sectorial ;
2525 UnitOption unitOption ;
2626 HackingProgram hackingProgram ;
27+ List <MartialArtLevel > martialArtLevels ;
2728
2829 private static Stream <Arguments > generateTestData () {
2930 List <Arguments > testData = new ArrayList <>();
@@ -46,10 +47,12 @@ void setup() {
4647 underTest = new HtmlPrinter ();
4748 sectorial = new Sectorial (1 , 1 , "name" , "slug" , false , "logo.png" );
4849
49- List <Skill > skills = List .of (new Skill (1 , "skill" , "wiki" , 1 , List .of (
50- new ExtraValue (2 , "extra" , ExtraValue .Type .Text , null ),
51- new ExtraValue (3 , "extra distance" , ExtraValue .Type .Distance , 10f ))
52- ));
50+ List <Skill > skills = List .of (
51+ new Skill (1 , "skill" , "wiki" , 1 , List .of (
52+ new ExtraValue (2 , "extra" , ExtraValue .Type .Text , null ),
53+ new ExtraValue (3 , "extra distance" , ExtraValue .Type .Distance , 10f ))
54+ ),
55+ new Skill (2 , "Martial Arts L3" , "wiki" , 1 , List .of ()));
5356 List <Weapon > weapons = List .of (
5457 new Weapon (4 , Weapon .Skill .BS , Weapon .Type .WEAPON , "weapon name" , "mode" , "wiki" , new Ammunition (4 , "ammo" , "wiki" ), "3" , "7" , "saving" , "savingNum" , List .of ("property" ), "+3" , "+3" , "0" , "-3" , "-3" , "-6" , "+6" , "profile" , 2 , List .of (
5558 new ExtraValue (1 , "PS=6" , ExtraValue .Type .Text , null ),
@@ -99,14 +102,17 @@ void setup() {
99102 ));
100103 TrooperProfile trooperProfile = new TrooperProfile (sectorial , 1 , 2 , 3 , 4 , "name" , List .of (10 , 10 ), 10 , 10 , 10 , 10 , 3 , 3 , 2 , false , 2 , "notes" , "type" , 3 , weapons , skills , equipments , List .of ("char1" , "char2" ), "logo.png" , List .of ("image.png" ), List .of (new Order (Order .Type .REGULAR , 0 , 1 )));
101104 Trooper trooper = new Trooper (sectorial , 1 , 2 , 3 , "optionName" , "category" , "0.5" , 20 , List .of (trooperProfile ), List .of (), "note" , "groupNote" );
105+ martialArtLevels = List .of (new MartialArtLevel ("-3" , "-" , "+3" , "3" , "+1SD" ));
106+
102107 unitOption = new UnitOption (sectorial , 1 , 2 , 3 , "isc" , "iscAbbr" , "unitName" , "optionName" , "slug" , "unitOptionName" ,
103108 trooper , List .of (), 20 , "0.5" , "note" , false );
104109 }
105110
106111 @ ParameterizedTest
107112 @ MethodSource ("generateTestData" )
108113 void testHtml (boolean useInch , Set <Weapon .Type > weaponOption , boolean showImage , boolean showHackingProgram , HtmlPrinter .Template template ) {
109- underTest .writeCards (List .of (unitOption ), List .of (), fileName , "" , sectorial , "" , "" , "" , "" , useInch , weaponOption , showImage , showHackingProgram , template );
114+ fileName = "testFile_" + System .currentTimeMillis ();
115+ underTest .writeCards (List .of (unitOption ), List .of (), martialArtLevels , fileName , "" , sectorial , "" , "" , "" , "" , useInch , weaponOption , showImage , showHackingProgram , template );
110116
111117 assertThat (new File ("out/html/" + fileName + ".html" )).exists ();
112118 }
0 commit comments