Skip to content

Commit 601faf2

Browse files
committed
payload is not working
1 parent 32ac881 commit 601faf2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/OnDelayMockWithTwoTimersTest.st

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ NAMESPACE Simatic.Ax.Example
44
{TestFixture}
55
CLASS TestActiveWait
66
VAR
7-
_state : OnDelayMockState;
7+
_payloadinstance : OnDelayMockState;
88
testInstance : Testee;
99
END_VAR
1010

@@ -16,13 +16,13 @@ NAMESPACE Simatic.Ax.Example
1616
testInstance.ValueT2 := T#2s;
1717

1818
// Mock timer values after 5 seconds: Timer1 returns true, Timer2 returns false
19-
_state.StatusTimer1 := TRUE;
20-
_state.StatusTimer2 := FALSE;
19+
_payloadinstance.StatusTimer1 := TRUE;
20+
_payloadinstance.StatusTimer2 := FALSE;
2121

2222
// Mock-Setup
23-
AxUnit.Mocking.Mock('System.Timer.OnDelay', NAME_OF(OnDelayMock2Timer), THIS._state);
23+
AxUnit.Mocking.Mock(NAME_OF(OnDelay), NAME_OF(OnDelayMock2Timer), THIS._payloadinstance);
2424
testInstance.Execute(run := TRUE);
25-
AxUnit.Assert.Equal(FALSE, testInstance.GetTimerState(1)); // expected true --> but something went wrong
25+
AxUnit.Assert.Equal(TRUE, testInstance.GetTimerState(1)); // expected true --> but something went wrong
2626
AxUnit.Assert.Equal(FALSE, testInstance.GetTimerState(2));
2727

2828
END_METHOD

0 commit comments

Comments
 (0)