33using Europa1400 . Tools . Pipeline . Converter ;
44using Europa1400 . Tools . Pipeline . Decoder ;
55using 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 ;
116using Xunit . Abstractions ;
127
138namespace Europa1400 . Tools . Tests ;
@@ -22,14 +17,14 @@ public async Task TestProgress()
2217 var progress = new Progress < PipelineProgress > ( p =>
2318 {
2419 progressUpdates . Add ( p ) ;
25- testOutputHelper . WriteLine ( $ "[ { p . CurrentStep } / { p . TotalSteps } ] { p . Percent : P0 } - { p . Message } " ) ;
20+ testOutputHelper . WriteLine ( p . ToString ( ) ) ;
2621 } ) ;
2722
2823 var pipeline = PipelineBuilder < DummyAsset >
2924 . Create ( )
30- . DecodeWith < DummyDecoder , object > ( )
31- . ConvertWith < DummyConverter , object , List < IFileExport > > ( )
32- . WriteWith < DummyOutputHandler , List < IFileExport > > ( )
25+ . DecodeWith < DummyDecoder > ( )
26+ . ConvertWith < DummyConverter > ( )
27+ . Write ( )
3328 . Build ( ) ;
3429
3530 await pipeline . ExecuteAsync (
@@ -38,80 +33,82 @@ await pipeline.ExecuteAsync(
3833 ) ;
3934
4035 Assert . NotEmpty ( progressUpdates ) ;
41-
42- var final = progressUpdates [ ^ 1 ] ;
43- Assert . Equal ( final . TotalSteps , final . CurrentStep ) ;
44- Assert . Equal ( 1.0 , final . Percent , 2 ) ;
4536 }
4637
4738 [ Fact ( Skip = "This test does not work yet." ) ]
4839 public async Task TestMeshes ( )
4940 {
5041 await PipelineBuilder < BgfAsset >
5142 . Create ( )
52- . DecodeWith < BgfDecoder , BgfStruct > ( )
43+ . DecodeWith < BgfDecoder > ( )
5344 . Build ( )
5445 . ExecuteAsync ( GameAssets . OfType < BgfAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
5546 }
5647
5748 [ Fact ]
5849 public async Task TestSounds ( )
5950 {
60- var outputPath = Path . Combine ( "output" , "sounds" ) ;
51+ var outputPath = Path . Combine ( "output" , "Sounds" ) ;
52+ var progress = new Progress < PipelineProgress > ( p => testOutputHelper . WriteLine ( p . ToString ( ) ) ) ;
6153
6254 await PipelineBuilder < SbfAsset >
6355 . Create ( )
64- . DecodeWith < SbfDecoder , SbfStruct > ( )
65- . ConvertWith < SbfConverter , SbfStruct , List < IFileExport > > ( )
66- . WriteWith < FileExportOutputHandler , List < IFileExport > > ( new OutputHandlerOptions { OutputRoot = outputPath } )
56+ . DecodeWith < SbfDecoder > ( )
57+ . ConvertWith < SbfConverter > ( )
58+ . Write ( new OutputHandlerOptions { OutputRoot = outputPath } )
6759 . Build ( )
68- . ExecuteAsync ( GameAssets . OfType < SbfAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
60+ . ExecuteAsync ( GameAssets . OfType < SbfAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) , progress ) ;
6961
7062 Assert . True ( Directory . GetFiles ( outputPath , "*.wav" , SearchOption . AllDirectories ) . Length > 0 ) ;
7163 }
7264
7365 [ Fact ]
7466 public async Task TestGraphics ( )
7567 {
76- var outputPath = Path . Combine ( "output" , "graphics" ) ;
68+ var outputPath = Path . Combine ( "output" , "Graphics" ) ;
69+ var progress = new Progress < PipelineProgress > ( p => testOutputHelper . WriteLine ( p . ToString ( ) ) ) ;
7770
7871 await PipelineBuilder < GfxAsset >
7972 . Create ( )
80- . DecodeWith < GfxDecoder , GfxStruct > ( )
81- . ConvertWith < GfxConverter , GfxStruct , List < IFileExport > > ( )
82- . WriteWith < FileExportOutputHandler , List < IFileExport > > ( new OutputHandlerOptions { OutputRoot = outputPath } )
73+ . DecodeWith < GfxDecoder > ( )
74+ . ConvertWith < GfxConverter > ( )
75+ . Write ( new OutputHandlerOptions { OutputRoot = outputPath } )
8376 . Build ( )
84- . ExecuteAsync ( GameAssets . OfType < GfxAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
77+ . ExecuteAsync ( GameAssets . OfType < GfxAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) , progress ) ;
8578
8679 Assert . True ( Directory . GetFiles ( outputPath , "*.png" , SearchOption . AllDirectories ) . Length > 0 ) ;
8780 }
8881
8982 [ Fact ]
9083 public async Task TestAgeb ( )
9184 {
92- var outputPath = Path . Combine ( "output" , "ageb" ) ;
85+ var outputPath = Path . Combine ( "output" ) ;
86+ var progress = new Progress < PipelineProgress > ( p => testOutputHelper . WriteLine ( p . ToString ( ) ) ) ;
9387
9488 await PipelineBuilder < AgebAsset >
9589 . Create ( )
96- . DecodeWith < AgebDecoder , AgebStruct > ( )
97- . WriteWith < FileExportOutputHandler , List < IFileExport > > ( new OutputHandlerOptions { OutputRoot = outputPath } )
90+ . DecodeWith < AgebDecoder > ( )
91+ . Write ( new OutputHandlerOptions { OutputRoot = outputPath } )
9892 . Build ( )
99- . ExecuteAsync ( GameAssets . OfType < AgebAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
93+ . ExecuteAsync ( GameAssets . OfType < AgebAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ,
94+ progress ) ;
10095
10196 Assert . True ( Directory . GetFiles ( outputPath , "*.json" , SearchOption . AllDirectories ) . Length > 0 ) ;
10297 }
10398
10499 [ Fact ]
105100 public async Task TestAobj ( )
106101 {
107- var outputPath = Path . Combine ( "output" , "aobj" ) ;
102+ var outputPath = Path . Combine ( "output" ) ;
103+ var progress = new Progress < PipelineProgress > ( p => testOutputHelper . WriteLine ( p . ToString ( ) ) ) ;
108104
109105 await PipelineBuilder < AobjAsset >
110106 . Create ( )
111- . DecodeWith < AobjDecoder , AobjStruct > ( )
112- . WriteWith < FileExportOutputHandler , List < IFileExport > > ( new OutputHandlerOptions { OutputRoot = outputPath } )
107+ . DecodeWith < AobjDecoder > ( )
108+ . Write ( new OutputHandlerOptions { OutputRoot = outputPath } )
113109 . Build ( )
114- . ExecuteAsync ( GameAssets . OfType < AobjAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ) ;
110+ . ExecuteAsync ( GameAssets . OfType < AobjAsset > ( ) . FromGameInstallation ( EnvVariables . GameDirectoryPath ) ,
111+ progress ) ;
115112
116113 Assert . True ( Directory . GetFiles ( outputPath , "*.json" , SearchOption . AllDirectories ) . Length > 0 ) ;
117114 }
0 commit comments