Parcourir la source

Merge branch 'master' of https://github.com/Yakindu/statecharts.git

Andreas Muelder il y a 8 ans
Parent
commit
b718015f5d
1 fichiers modifiés avec 23 ajouts et 0 suppressions
  1. 23 0
      plugins/org.yakindu.sct.doc.user/src/user-guide/sctunit.textile

+ 23 - 0
plugins/org.yakindu.sct.doc.user/src/user-guide/sctunit.textile

@@ -263,6 +263,29 @@ assert myVariable3 => 41
 assert InterfaceName.MyEvent == 5
 
 p. ==<!-- End sctunit_keyword_assert -->==
+==<!-- Start sctunit_keyword_assert_called -->==
+
+h4. assert called
+
+The expression followed by the 'assert called' keywords expects a reference to an operation that will be called and optional the keyword 'with' and the parameters of the call. If the referenced operation wasn't called or wasn't called with the right parameters, the test will fail. The following example shows a statement that asserts if a operation was called or not.
+
+bc(prettyprint). assert called operationname
+assert called operationname with (param1, param2)
+
+p. ==<!-- End sctunit_keyword_assert_called -->==
+==<!-- Start sctunit_keyword_mock -->==
+
+h4. mock
+
+With the 'mock' Statement it is possible to return a default value for an operation call, without implementing the operation. The type of the default value has to match the return-type of the referenced operation. The following example shows a statement that mocks the default return of an operation.
+
+bc(prettyprint). mock operationname returns (value)
+
+It is also possible to make the default return dependent from the operation parameters.
+
+bc(prettyprint). mock operationname returns (paramname + 1.0)
+
+p. ==<!-- End sctunit_keyword_mock -->==
 ==<!-- Start sctunit_keyword_cycle -->==
 
 h4. cycle