Closed nico10hahn closed 1 year ago
Yes, this is possible. You open the file like you would normally do, and then simply assert that the content is what you expect.
Thanks for answer and the help,
to read the JSON file I use the code from the "Getting started" from Beckhoff Homepage.
This is the main programm (just call the FB), for testing I added the whole code in the FB (later i want to use methods as in your youtube channel and the examples).
The FB with the TC_Unit interface looks like that:
-> It only logs the "I Arrive here: Yes" message. -> When I use the same code and call the FB without TcUnit.Run() I get many logging messags with timestamp. -> It seems that "TcUnit.RUN()" calls the FB only onves even when I don't use "FINISHED()" in the FB.
EDIT: only solution I found:
Thanks for help
I want to use TC_Unit to check if a JSON File is written correctly by a function of my library. Therefore I want to create a test FB, which opens the written file and check if the test string is written inside the file (for example timestamp). I will parse the JSON Document with FB_JsonDomParser from TC3_JsonXml.
I tried different ways but doesn't work. Its possible to parse a document when I call the FB with TCUnit.Run() ?
When I usw my code in a normal FB I can read the timestamp.
Thanks for help