wiki Discussion
robert
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-11-12
home Discussion
AP Unittest Framework
home
(Discussion)
Forum for home comments
Last updated: 2018-11-14
code Discussion
AP Unittest Framework
code
(Discussion)
Forum for code comments
Last updated: 2018-11-14
wiki Discussion
AP Unittest Framework
wiki
(Discussion)
Forum for wiki comments
Last updated: 2019-03-12
Home
robert
wiki
(WikiPage)
This is the personal project of robert. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2018-11-12
Home
kevin
wiki
(WikiPage)
This is the personal project of kevin. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2018-11-14
(no subject)
kevin
wiki
(Thread)
Last updated: 2018-11-14
Home (version 1) discussion
kevin
wiki
(Thread)
Home (version 1) discussion
Last updated: 2018-12-07
wiki Discussion
kevin
wiki
(Discussion)
Forum for wiki comments
Last updated: 2018-11-14
Home
AP Unittest Framework
home
(WikiPage)
Project Members: kevin (admin)
Last updated: 2019-07-19
Howto
AP Unittest Framework
wiki
(WikiPage)
For whom is it? Customers who have purchased Automation Platform and who develop their own plug-ins for the CODESYS development system. What is it? Automation Platform uses its own proprietary implementation for dependency injection, and it turns out to be rather hard to develop unit tests for plug-ins which require external dependencies. Therefore the APUnitTestFramework is a software component which mimics the CODESYS environment during the runtime of a unit test, and which enables resetting the environment to its initial state (which is not a feature in the real Automation Platform at all, for various reasons). How to build it? You must adapt the references in the solution and the csproj files to your individual installation of the Automation Platform SDK, as well as the postbuild step. After that, building and installing the APUnitTestFramework.plugin.dll should be no problem for experienced Automation Platform developers. How to use it? Instantiate the Testbed class (preferably in a using-statement, as it requires disposal at the end of the test). If you require entire plug-ins as dependencies for your testee plug-in, use the IncludeAdditionalPlugInGuid method (not recommended at all, as it contradicts the sense of a unit test). If you require mocks for dependencies for your testee plug-in, use the AddMock methods. The parameters are mainly the TypeGuid to be mocked, and a factory method to create the mock instance on demand. Take care of the boolean systemInstance parameter as well. Initialize the testbed. This is the same as starting up a CODESYS instance with the specified dependencies. You do not need to prepare any version profiles; this is done automagically by the APUnitTestFramework. Do your tests. Dispose the testbed (if not used in a using-statement). Notes APUnitTestFramework only works for dependencies which are declared using our own Dependency Injection mechanisms. For older plug-ins which are using the legacy ComponentManager calls, this framework will not be useful at all. If your tests fail due to unresolved references, you can attach to the Testbed's DependencyError event to find out details. We do not actively support this framework as a product. It works in-house in a couple of ways, so we are fine with the current state. If it does not work for you (remember: many Automation Platform customers have quite customized environments), then we cannot help. Feel free to dive into the code by yourself; there's a lot to learn about the internal workings of the Automation Platform.
Last updated: 2019-05-08
Post by aliazzz on Discussion for Home page
AP Unittest Framework
home
(Post)
I hope you now understand why I have been curious? See [CfUnit] project
Last updated: 2019-07-19
Post by aliazzz on Discussion for Home page
AP Unittest Framework
home
(Post)
Hi Kevin, I am very curious/interested in this project, can you lift the curtain a bit and explain a something on it's purpose with us? thank in advance and hoping to hear from you. Aliazzz
Last updated: 2019-03-09
Post by aliazzz on Discussion for Howto page
AP Unittest Framework
wiki
(Post)
This explanation is rather hard to find via [Home], which is a shame I think. Could you please fix that? Thank you in advance!
Last updated: 2019-05-08
Howto (version 2) discussion
AP Unittest Framework
wiki
(Thread)
Howto (version 2) discussion
Last updated: 2019-03-17
Home (version 1) discussion
AP Unittest Framework
home
(Thread)
Home (version 1) discussion
Last updated: 2018-12-07
(no subject)
AP Unittest Framework
home
(Thread)
Last updated: 2019-07-19
(no subject)
AP Unittest Framework
wiki
(Thread)
Last updated: 2019-05-08
Howto (version 1) discussion
AP Unittest Framework
wiki
(Thread)
Howto (version 1) discussion
Last updated: 2019-03-17
Home (version 42) discussion
I2C-IoDrvMEGA IO
home
(Thread)
Home (version 42) discussion
Last updated: 2019-01-24