11package com.tomwyr
22
3- import com.tomwyr.generator.NodeTreeGenerator
4- import com.tomwyr.utils.GodotKotlinProject
3+ import com.tomwyr.command.GenerateTreeCommand
54import java.io.File
6- import kotlin.test.BeforeTest
75import kotlin.test.Test
86import kotlin.test.assertEquals
97
@@ -34,10 +32,10 @@ class GeneratorTest {
3432 }
3533}
3634
37- fun test (testCase : String , targetPackage : String ) {
35+ fun test (testCase : String , packageName : String ) {
3836 try {
39- val project = setUpTestProject (testCase, targetPackage )
40- NodeTreeGenerator ().generate(project )
37+ val command = setUpTestCommand (testCase, packageName )
38+ command. run ( )
4139 assertOutputsEqual(testCase)
4240 } finally {
4341 cleanUpGeneratedOutput(testCase)
@@ -46,11 +44,12 @@ fun test(testCase: String, targetPackage: String) {
4644
4745const val basePath = " src/test/resources/"
4846
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,
5453 )
5554}
5655
0 commit comments