1- using Europa1400 . Tools . Converter ;
2- using Xunit . Sdk ;
1+ using Europa1400 . Tools . Pipeline ;
2+ using Europa1400 . Tools . Pipeline . Assets ;
3+ using Europa1400 . Tools . Pipeline . Converter ;
4+ using Europa1400 . Tools . Pipeline . Decoder ;
5+ using Europa1400 . Tools . Pipeline . Output ;
6+ using Europa1400 . Tools . Structs . Ageb ;
7+ using Europa1400 . Tools . Structs . Aobj ;
8+ using Europa1400 . Tools . Structs . Bgf ;
9+ using Europa1400 . Tools . Structs . Gfx ;
10+ using Europa1400 . Tools . Structs . Sbf ;
11+ using Xunit . Abstractions ;
312
413namespace Europa1400 . Tools . Tests ;
514
6- public class Europa1400Test
15+ public class Europa1400Test ( ITestOutputHelper testOutputHelper )
716{
817 [ Fact ]
9- public void TestSoundConverter ( )
18+ public void TestMeshes ( )
1019 {
11- var path = EnvVariables . GameDirectoryPath ;
12-
13- var soundConverter = new SoundConverter ( ) ;
14- var tempTargetPath = Directory . CreateTempSubdirectory ( "Sound" ) ;
15-
16- soundConverter . Convert ( path , tempTargetPath . FullName ) ;
17-
18- var tempTargetPathSound = new DirectoryInfo ( Path . Combine ( tempTargetPath . FullName , "Sound" ) ) ;
19-
20- Assert . True ( tempTargetPathSound . Exists ) ;
21- Assert . True ( tempTargetPathSound . GetFiles ( "*.wav" , SearchOption . AllDirectories ) . Length > 0 ) ;
22-
23- tempTargetPath . Delete ( true ) ;
20+ PipelineBuilder < BgfAsset >
21+ . Create ( )
22+ . DecodeWith < BgfDecoder , BgfStruct > ( )
23+ . Build ( )
24+ . Execute ( GameAssets . OfType < BgfAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
2425 }
2526
2627 [ Fact ]
27- public void TestGraphicsConverter ( )
28+ public void TestSounds ( )
2829 {
29- var path = EnvVariables . GameDirectoryPath ;
30+ var outputPath = Path . Combine ( "output" , "sounds" ) ;
3031
31- var graphicsConverter = new GraphicsConverter ( ) ;
32- var tempTargetPath = Directory . CreateTempSubdirectory ( "Graphics" ) ;
32+ PipelineBuilder < SbfAsset >
33+ . Create ( )
34+ . DecodeWith < SbfDecoder , SbfStruct > ( )
35+ . ConvertWith < SbfConverter , SbfStruct , List < IFileExport > > ( )
36+ . WriteTo ( outputPath )
37+ . Build ( )
38+ . Execute ( GameAssets . OfType < SbfAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
3339
34- graphicsConverter . Convert ( path , tempTargetPath . FullName ) ;
40+ Assert . True ( Directory . GetFiles ( outputPath , "*.wav" , SearchOption . AllDirectories ) . Length > 0 ) ;
41+ }
3542
36- var tempTargetPathGraphics = new DirectoryInfo ( Path . Combine ( tempTargetPath . FullName , "Graphics" ) ) ;
43+ [ Fact ]
44+ public void TestGraphics ( )
45+ {
46+ var outputPath = Path . Combine ( "output" , "graphics" ) ;
3747
38- Assert . True ( tempTargetPathGraphics . Exists ) ;
39- Assert . True ( tempTargetPathGraphics . GetFiles ( "*.png" , SearchOption . AllDirectories ) . Length > 0 ) ;
48+ PipelineBuilder < GfxAsset >
49+ . Create ( )
50+ . DecodeWith < GfxDecoder , GfxStruct > ( )
51+ . ConvertWith < GfxConverter , GfxStruct , List < IFileExport > > ( )
52+ . WriteTo ( outputPath )
53+ . Build ( )
54+ . Execute ( GameAssets . OfType < GfxAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
4055
41- tempTargetPath . Delete ( true ) ;
56+ Assert . True ( Directory . GetFiles ( outputPath , "*.png" , SearchOption . AllDirectories ) . Length > 0 ) ;
4257 }
4358
4459 [ Fact ]
45- public void TestAgebConverter ( )
60+ public void TestAgeb ( )
4661 {
47- var path = EnvVariables . GameDirectoryPath ;
48- var agebConverter = new AgebConverter ( ) ;
49- var tempTargetPath = Directory . CreateTempSubdirectory ( "Ageb" ) ;
62+ var outputPath = Path . Combine ( "output" , "ageb" ) ;
5063
51- agebConverter . Convert ( path , tempTargetPath . FullName ) ;
64+ PipelineBuilder < AgebAsset >
65+ . Create ( )
66+ . DecodeWith < AgebDecoder , AgebStruct > ( )
67+ . WriteTo ( outputPath )
68+ . Build ( )
69+ . Execute ( GameAssets . OfType < AgebAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
5270
53- Assert . True ( tempTargetPath . Exists ) ;
54- Assert . True ( tempTargetPath . GetFiles ( "*.json" , SearchOption . AllDirectories ) . Length > 0 ) ;
71+ Assert . True ( Directory . GetFiles ( outputPath , "*.json" , SearchOption . AllDirectories ) . Length > 0 ) ;
5572 }
5673
5774 [ Fact ]
58- public void TestAobjConverter ( )
75+ public void TestAobj ( )
5976 {
60- var path = EnvVariables . GameDirectoryPath ;
61- var aobjConverter = new AobjConverter ( ) ;
62- var tempTargetPath = Directory . CreateTempSubdirectory ( "Aobj" ) ;
77+ var outputPath = Path . Combine ( "output" , "aobj" ) ;
6378
64- aobjConverter . Convert ( path , tempTargetPath . FullName ) ;
79+ PipelineBuilder < AobjAsset >
80+ . Create ( )
81+ . DecodeWith < AobjDecoder , AobjStruct > ( )
82+ . WriteTo ( outputPath )
83+ . Build ( )
84+ . Execute ( GameAssets . OfType < AobjAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
6585
66- Assert . True ( tempTargetPath . Exists ) ;
67- Assert . True ( tempTargetPath . GetFiles ( "*.json" , SearchOption . AllDirectories ) . Length > 0 ) ;
86+ Assert . True ( Directory . GetFiles ( outputPath , "*.json" , SearchOption . AllDirectories ) . Length > 0 ) ;
6887 }
69- }
88+ }
0 commit comments