Skip to main content

AbstractAssertor

Short summary

This abstract class provides assert statements in a fluent interface_ style for the most common data types. It implements the interfaces IAssertor and IAssertCallBack If you need assertion statements you've to extend this class and you've to overwrite the methods AbstractAssertor.assertionWasWrong AbstractAssertor.className

.. _fluent interface: https://en.wikipedia.org/wiki/Fluent_interface

AccessAbstractFinalExtendsImplements
YesNoCNM_AbstractObject.ObjectIAssertor, IAssertCallBack

UML Diagram

Parameters

none

Properties

assert

Type: IAssertions

Returns the interface IAssertions

className

Type: CNM_AbstractObject.ClassName

This abstract property returns the class name of the concrete object,

Methods

FB_init

  • Parameters:
    • bInitRetains (BOOL): if TRUE, the retain variables are initialized (warm start / cold start)
    • bInCopyCode (BOOL): if TRUE, the instance afterwards gets moved into the copy code (online change)
  • Return type: BOOL

The constructor FB_init is needed to create an unique hash code.

Abstract methods

assertionWasWrong

  • Parameters:
  • Return type: VOID

This method is called if an assertion was FALSE

Code

Declaration

{attribute 'reflection'}
FUNCTION_BLOCK ABSTRACT AbstractAssertor EXTENDS CNM_AbstractObject.Object IMPLEMENTS IAssertor, IAssertCallBack
VAR
(* class to handle all the worth assertions *)
{attribute 'hide'}
assertions :Assertions();
END_VAR