From e90abf6b2bae0d6b8673d14c1839f5d49aef5a92 Mon Sep 17 00:00:00 2001 From: MarcusRost Date: Sat, 7 Oct 2023 11:19:56 +0200 Subject: [PATCH] added new branch for issue #8 --- .gitignore | 3 ++- tests/test_end_constraints.py | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a209f38..3d52a70 100644 --- a/.gitignore +++ b/.gitignore @@ -137,4 +137,5 @@ dmypy.json .vscode/ # This might be weird, but I think this is where the conf.py should be -tutorial/conf.py \ No newline at end of file +tutorial/conf.py +test.mmd \ No newline at end of file diff --git a/tests/test_end_constraints.py b/tests/test_end_constraints.py index 963c20f..0711df8 100644 --- a/tests/test_end_constraints.py +++ b/tests/test_end_constraints.py @@ -1,7 +1,8 @@ -from test_utils import init_test_setup_for_compiler +from test_utils import init_test_setup_for_compiler, init_test_setup_for_parser from file_constants import ( MULTIPLE_ENDINGS_DIAGRAM, LINEAR_SEQUENCE_DIAGRAM_WITHOUT_START_AND_END, + XOR_GATEWAY_SEQUENCE_DIAGRAM ) @@ -18,3 +19,16 @@ def test_end_constraint_is_generated_when_multiple_endings(): def test_end_constraint_is_generated_without_explicit_end_event(): res = init_test_setup_for_compiler(LINEAR_SEQUENCE_DIAGRAM_WITHOUT_START_AND_END) assert "End[second element]" in res + +def test_end_constraint_is_generated_when_multiple_endings(): + res = init_test_setup_for_parser(MULTIPLE_ENDINGS_DIAGRAM) + expected_ending_constraints = [ + "End[activity four]", + "End[action five]", + ] + assert all(constraint in res for constraint in expected_ending_constraints) + +def test_end_constraint_is_generated_when_xor_gateway(): + res = init_test_setup_for_compiler(XOR_GATEWAY_SEQUENCE_DIAGRAM) + assert "End[second element]" in res + assert "End[third element]" in res \ No newline at end of file