Skip to content

Commit

Permalink
Fixed up Unit tests for recent repository changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveIves committed Mar 13, 2024
1 parent d090c2e commit 95c4713
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions UnitTests/EnvironmentConfig.dbl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import System.IO
import System.Text
import Microsoft.VisualStudio.TestTools.UnitTesting
import System.Diagnostics
import CodeGen.RepositoryAPI

namespace UnitTests

{TestClass}
public class EnvironmentConfig

public static Repository, @Repository

{AssemblyInitialize}
public static method AssemblyInitialize, void
context, @TestContext
Expand All @@ -18,6 +21,7 @@ namespace UnitTests
xcall setlog("RPSMFIL","..\..\SampleRepository\rpsmain.ism",sts)
xcall setlog("RPSTFIL","..\..\SampleRepository\rpstext.ism",sts)
xcall setlog("CODEGEN_EXE",".",sts)
Repository = new Repository("..\..\SampleRepository\rpsmain.ism","..\..\SampleRepository\rpstext.ism")
endmethod

endclass
Expand Down
10 changes: 5 additions & 5 deletions UnitTests/Simulate.dbl
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ namespace UnitTests

public method Simulate
required in structureName, String
endparams
proc

Environment.SetEnvironmentVariable("CODEGEN_EXE",Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(^typeof(CodeGenerator)).Location))

str = new RpsStructure(context.Repository,structureName)

taskset = new CodeGenTaskSet()
task = new CodeGenTask()
task.Structures.Add(structureName)
taskset.Tasks.Add(task)

context = new CodeGenContext(taskset)
context = new CodeGenContext(taskset)
context.Repository = EnvironmentConfig.Repository
context.CurrentTask = task
context.StructureFileIndex = new int[1]
context.StructureFileIndex[0] = 0
context.CurrentFileIndex = 0

str = new RpsStructure(context.Repository,structureName)

context.SetCurrentStructure(str)

context.UserTokens = new List<UserToken>()
Expand Down

0 comments on commit 95c4713

Please sign in to comment.