Mocking of overloaded functions - Manual - AxUnit - AxUnit - AxUnit,

AxUnit (legacy) CLI Tool (test)

Portfolio
SIMATIC AX
Product
AxUnit
Software version
2.0.9
Edition
08/2025
Language
English (original)
Package Name
@ax/axunit-docs

AxUnit supports mocking of non-overloaded and overloaded functions. Whereby the mocking of overloaded functions increases the complexity of a mock setup. Therefore AxUnit guides you with the following warnings and errors:

  • Not all of mockee function overloads have corresponding overload of mock function. is shown as warning when not all overloads of a function are mocked. AxUnit does not enforce writing mocks for all of overloads, but warns that it could lead to unexpected behavior at runtime.

  • There are no mock functions matching the corresponding mockee signature is shown as error when AxUnit detected that the mock setup refers to a mock function, that has no corresponding mockee function. A common mistake could be a difference in name of variables or their types.

  • Expect name of existing function is shown as error when either the mock or the mockee function could not be found in the program. Check if namespaces and function names are written correctly!