How to Mock OnDelay within FB?

0
Hi there,    I want to Unit Test an FB with an OnDelay as local var. I tried the mocking framework AXUnit-Mocking, but as far as I understand its not possible to access the local var inside the FB and only mock instances within the test class.    Does anyone have an idea how to mock the systemTimer inside an FB ?    Thanks in advance!    Best Patrick
asked
1 answers
2

Hi Patrick, 

 

thanks for your request. I already sent you the link on the GitHub Community. Thanks for sharing it here. 

 

There are some additional information:

- the https://github.com/simatic-ax/mocks library is indented to install them as a devDependency in your project. But unfortunately it does currently not work. So you need to copy the code of the mocks in your project

- Mocking (e.g. a OnDelay) will mock all OnDelay-Instances in the test (you can't mock single instances). 

 

 

Regards

Juergen

answered