Closed larshei closed 1 year ago
Setup and Verify check if mocked functions were called or not. So if you do not "Expect" a function then the test will pass when no function is called, and if you do not "Expect" and function is called, it will fail the test case.
Ah I see.
So a mocked function being called would immediately fail the test, if not expected, meaning having 0 Expect functions means the function is called 0 times when the test passes.
Thanks!
I am currently writing a function which parses an incoming data stream.
Whenever a linefeed is found, a callback should be called, passing in a line.
Here is a test that shows the behaviour when a line break is found:
Now I want to test what happens if no linefeed char is found in the input. In this case, as we did not complete a line, I would like to not call the callback function:
I went through the temp_sensor example and the docs, but I could not figure out how to do this. Is there a way to check that a mocked function was not called?