Skip to content

Feature Request: Use TcUnit without extending TcUnit.Fb_TestSuite #199

Answered by PTKu
RGrabichler asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

here is a possible solution/workaround.

You will need to inherit from TcUnit.Fb_TestSuite block and implement TcoCore.ITcoContext interface

FUNCTION_BLOCK TcUnitContext EXTENDS TcUnit.Fb_TestSuite IMPLEMENTS TcoCore.ITcoContext
VAR
	_nfContext : TcoCore.TcoContextNfCompatibility;
END_VAR

TcoCore.TcoContextNfCompatibility is a class that allows to use TcOpen components in a non TcOpen framewok application.

You will also need to implement members of TcoCore.ITcoContext.

Where in all getters you will need to return values from the instance of _nfContext

Context := THIS^._nfContext;
EndCycleCount := THIS^._nfContext._endCycleCount;
Environment := THIS^._nfContext._settings;
Identity …

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@RGrabichler
Comment options

@RGrabichler
Comment options

Comment options

You must be logged in to vote
2 replies
@RGrabichler
Comment options

@rruiter87
Comment options

Answer selected by sagatowski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #198 on December 05, 2022 17:08.