@@ -8,6 +8,14 @@ namespace SimdJsonSharp.Tests
88{
99 public class MinifierTests
1010 {
11+ private string testDataDir ;
12+
13+ public MinifierTests ( )
14+ {
15+ string currentDir = Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
16+ testDataDir = Path . Join ( Directory . GetParent ( currentDir ) . Parent . Parent . Parent . FullName , "jsonexamples" ) ;
17+ }
18+
1119 //[Fact]
1220 public void ValidateMinifier ( )
1321 {
@@ -24,9 +32,6 @@ public void ValidateMinifier()
2432 [ Fact ]
2533 public unsafe void ValidateMinimizedJson ( )
2634 {
27- string currentDir = Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
28- string testDataDir = Path . Combine ( currentDir , @"../../../../jsonexamples" ) ;
29-
3035 string [ ] files = Directory . GetFiles ( testDataDir , "*.json" , SearchOption . AllDirectories ) ;
3136 // 20 files, ~15Mb of JSON
3237 Assert . NotEmpty ( files ) ;
@@ -46,9 +51,6 @@ public unsafe void ValidateMinimizedJson()
4651 [ Fact ]
4752 public unsafe void ValidateMinimizedJsonN ( )
4853 {
49- string currentDir = Path . GetDirectoryName ( Assembly . GetExecutingAssembly ( ) . Location ) ;
50- string testDataDir = Path . Combine ( currentDir , @"../../../../jsonexamples" ) ;
51-
5254 string [ ] files = Directory . GetFiles ( testDataDir , "*.json" , SearchOption . AllDirectories ) ;
5355 // 20 files, ~15Mb of JSON
5456 Assert . NotEmpty ( files ) ;
0 commit comments