|
@@ -392,3 +392,56 @@ class TestPetrinetInterface(unittest.TestCase):
|
|
|
self.assertTrue(run_file(all_files,
|
|
|
["load", "PetriNets", "verify"],
|
|
|
init + load + loaded + ["OK"], mode))
|
|
|
+
|
|
|
+ def test_po_rpgame(self):
|
|
|
+ self.rpgame("PO")
|
|
|
+
|
|
|
+ def test_co_rpgame(self):
|
|
|
+ self.rpgame("CO")
|
|
|
+
|
|
|
+ def rpgame(self, mode):
|
|
|
+ self.assertTrue(run_file(all_files,
|
|
|
+ ["new", "SimpleClassDiagrams", "RPGame",
|
|
|
+ "instantiate", "Class", "Scene",
|
|
|
+ "instantiate", "Class", "Tile",
|
|
|
+ "instantiate", "Class", "Item",
|
|
|
+ "instantiate", "Class", "Goal",
|
|
|
+ "instantiate", "Class", "Character",
|
|
|
+ "instantiate", "Class", "Hero",
|
|
|
+ "instantiate", "Class", "String",
|
|
|
+ "instantiate", "Association", "scene_name", "Scene", "String",
|
|
|
+ "instantiate", "Association", "scene_has_tiles", "Scene", "Tile",
|
|
|
+ "instantiate", "Association", "tile_left", "Tile", "Tile",
|
|
|
+ "instantiate", "Association", "tile_right", "Tile", "Tile",
|
|
|
+ "instantiate", "Association", "tile_top", "Tile", "Tile",
|
|
|
+ "instantiate", "Association", "tile_bottom", "Tile", "Tile",
|
|
|
+ "instantiate", "Association", "character_on", "Character", "Tile",
|
|
|
+ "instantiate", "Association", "item_on", "Item", "Tile",
|
|
|
+ "instantiate", "Inheritance", "hero_is_character", "Hero", "Character",
|
|
|
+ "instantiate", "Inheritance", "goal_is_item", "Goal", "Item",
|
|
|
+ "attr_add", "Scene", "lower_cardinality", 1,
|
|
|
+ "attr_add", "Scene", "upper_cardinality", 1,
|
|
|
+ "attr_add", "Goal", "lower_cardinality", 1,
|
|
|
+ "attr_add", "scene_has_tiles", "source_lower_cardinality", 1,
|
|
|
+ "attr_add", "scene_has_tiles", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "scene_has_tiles", "target_lower_cardinality", 1,
|
|
|
+ "attr_add", "scene_name", "target_lower_cardinality", 1,
|
|
|
+ "attr_add", "scene_name", "target_upper_cardinality", 1,
|
|
|
+ "attr_add", "item_on", "target_lower_cardinality", 1,
|
|
|
+ "attr_add", "item_on", "target_upper_cardinality", 1,
|
|
|
+ "attr_add", "item_on", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "character_on", "target_lower_cardinality", 1,
|
|
|
+ "attr_add", "character_on", "target_upper_cardinality", 1,
|
|
|
+ "attr_add", "character_on", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_left", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_left", "target_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_right", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_right", "target_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_top", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_top", "target_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_bottom", "source_upper_cardinality", 1,
|
|
|
+ "attr_add", "tile_bottom", "target_upper_cardinality", 1,
|
|
|
+ "verify",
|
|
|
+ ],
|
|
|
+ init + new + loaded + (instantiate_node + prompt) * 7 + (instantiate_edge + prompt) * 10 + (attr_add + prompt) * 22 + ["OK"] + prompt,
|
|
|
+ mode))
|