public void initializeTest() { instruct = new InstructionDto(); var advent1 = new Adventurer { PosX = 0, PosY = 0, MovementList = "A", Name = "Indiana", FinishMoving = false, PlayerOrientation = "S", Treasures = 0 }; var advent2 = new Adventurer { PosX = 3, PosY = 3, MovementList = "ADDGA", Name = "Shia", FinishMoving = false, PlayerOrientation = "O", Treasures = 0 }; instruct.adventurer = new List <IAdventurer> { advent1, advent2 }; instruct.mapSizeX = 5; instruct.mapSizeY = 5; var mountain = new Mountain(1, 1) { GotAdventurer = false, tileType = TileType.MOUNTAIN }; var treasure = new Treasure(2, 2, 2) { GotAdventurer = false, tileType = TileType.TREASURE }; instruct.tiles = new List <ITile> { mountain, treasure }; map = new Map(5, 5); loopClassTest = new LoopClass(map); //Assert }
public void TestLoopScope() { var engine = new TemplateEngine().AddFile(GetExampleFilePath("LoopScope.lg")); var loopClass1 = new LoopClass(); loopClass1.Name = "jack"; var loopClass2 = new LoopClass(); loopClass2.Name = "jones"; loopClass1.LoopObj = loopClass2; loopClass2.LoopObj = loopClass1; engine.EvaluateTemplate("template1", new { scope = loopClass1 }); }
public void TestLoopScope() { var lgFile = LGParser.ParseFile(GetExampleFilePath("LoopScope.lg")); var loopClass1 = new LoopClass(); loopClass1.Name = "jack"; var loopClass2 = new LoopClass(); loopClass2.Name = "jones"; loopClass1.LoopObj = loopClass2; loopClass2.LoopObj = loopClass1; lgFile.EvaluateTemplate("template1", new { scope = loopClass1 }); }