1
1
package com.tomwyr
2
2
3
- import com.tomwyr.generator.NodeTreeGenerator
4
- import com.tomwyr.utils.GodotKotlinProject
3
+ import com.tomwyr.command.GenerateTreeCommand
5
4
import java.io.File
6
- import kotlin.test.BeforeTest
7
5
import kotlin.test.Test
8
6
import kotlin.test.assertEquals
9
7
@@ -34,10 +32,10 @@ class GeneratorTest {
34
32
}
35
33
}
36
34
37
- fun test (testCase : String , targetPackage : String ) {
35
+ fun test (testCase : String , packageName : String ) {
38
36
try {
39
- val project = setUpTestProject (testCase, targetPackage )
40
- NodeTreeGenerator ().generate(project )
37
+ val command = setUpTestCommand (testCase, packageName )
38
+ command. run ( )
41
39
assertOutputsEqual(testCase)
42
40
} finally {
43
41
cleanUpGeneratedOutput(testCase)
@@ -46,11 +44,12 @@ fun test(testCase: String, targetPackage: String) {
46
44
47
45
const val basePath = " src/test/resources/"
48
46
49
- fun setUpTestProject (testCase : String , targetPackage : String ): GodotKotlinProject {
50
- return GodotKotlinProject (
51
- " $basePath /$testCase /scenes" ,
52
- " $basePath /$testCase /Actual" ,
53
- targetPackage,
47
+ fun setUpTestCommand (testCase : String , packageName : String ): GenerateTreeCommand {
48
+ return GenerateTreeCommand (
49
+ libPath = " NodeTreeGenerator.dylib" ,
50
+ projectPath = " $basePath /$testCase /scenes" ,
51
+ outputPath = " $basePath /$testCase /Actual" ,
52
+ packageName = packageName,
54
53
)
55
54
}
56
55
0 commit comments