Skip to content

Commit 95c4713

Browse files
committed
Fixed up Unit tests for recent repository changes.
1 parent d090c2e commit 95c4713

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

UnitTests/EnvironmentConfig.dbl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import System.IO
44
import System.Text
55
import Microsoft.VisualStudio.TestTools.UnitTesting
66
import System.Diagnostics
7+
import CodeGen.RepositoryAPI
78

89
namespace UnitTests
910

1011
{TestClass}
1112
public class EnvironmentConfig
1213

14+
public static Repository, @Repository
15+
1316
{AssemblyInitialize}
1417
public static method AssemblyInitialize, void
1518
context, @TestContext
@@ -18,6 +21,7 @@ namespace UnitTests
1821
xcall setlog("RPSMFIL","..\..\SampleRepository\rpsmain.ism",sts)
1922
xcall setlog("RPSTFIL","..\..\SampleRepository\rpstext.ism",sts)
2023
xcall setlog("CODEGEN_EXE",".",sts)
24+
Repository = new Repository("..\..\SampleRepository\rpsmain.ism","..\..\SampleRepository\rpstext.ism")
2125
endmethod
2226

2327
endclass

UnitTests/Simulate.dbl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ namespace UnitTests
1818

1919
public method Simulate
2020
required in structureName, String
21-
endparams
2221
proc
23-
2422
Environment.SetEnvironmentVariable("CODEGEN_EXE",Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(^typeof(CodeGenerator)).Location))
2523

26-
str = new RpsStructure(context.Repository,structureName)
27-
2824
taskset = new CodeGenTaskSet()
2925
task = new CodeGenTask()
3026
task.Structures.Add(structureName)
3127
taskset.Tasks.Add(task)
3228

33-
context = new CodeGenContext(taskset)
29+
context = new CodeGenContext(taskset)
30+
context.Repository = EnvironmentConfig.Repository
3431
context.CurrentTask = task
3532
context.StructureFileIndex = new int[1]
3633
context.StructureFileIndex[0] = 0
3734
context.CurrentFileIndex = 0
35+
36+
str = new RpsStructure(context.Repository,structureName)
37+
3838
context.SetCurrentStructure(str)
3939

4040
context.UserTokens = new List<UserToken>()

0 commit comments

Comments
 (0)