|
|
Flowgorithm CLI supports kind of unit testing. The concept similar to ordinary testing framework. You have a file with your code and a second file with unit tests.
|
|
|
|
|
|
In your testing function you prepare the conditions for test, call the tested method and assert the results. The assertion is done via set of methods:\
|
|
|
\`\`\`\
|
|
|
In your testing function you prepare the conditions for test, call the tested method and assert the results. The assertion is done via set of methods:
|
|
|
```
|
|
|
AssertAreEqualInts(Integer expected, Integer actual, String message)
|
|
|
|
|
|
AssertAreEqualReals(Real expected, Real actual, String message)
|
|
|
|
|
|
AssertAreEqualBools(Boolean expected, Boolean actual, String message)
|
|
|
|
|
|
AssertAreEqualStrings(String expected, String actual, String message)
|
|
|
|
|
|
AssertAreNotEqualInts(Integer expected, Integer actual, String message)
|
|
|
|
|
|
AssertAreNotEqualReals(Real expected, Real actual, String message)
|
|
|
|
|
|
AssertAreNotEqualBools(Boolean expected, Boolean actual, String message)
|
|
|
|
|
|
AssertAreNotEqualStrings(String expected, String actual, String message)
|
|
|
|
|
|
AssertIsTrue(Boolean condition, String message)
|
|
|
|
|
|
AssertIsFalse(Boolean condition, String message)
|
|
|
|
|
|
\`\`\`
|
|
|
|
|
|
##
|
|
|
|
|
|
##
|
|
|
|
|
|
```
|
|
|
## Video
|
|
|
|
|
|
[Flowgorithm-unit_tests](/uploads/709f2a554270e4c51d17636cf85eff38/Flowgorithm-unit_tests.mp4) |
|
|
\ No newline at end of file |