Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuergen committed Mar 1, 2024
1 parent 232c63f commit 60f66b4
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions test/TestTwoWayActuator.st
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
// USING Simatic.Ax.Commands;
// USING AxUnit.Assert;
USING Simatic.Ax.Commands;
USING AxUnit.Assert;

// NAMESPACE Simatic.Ax.Actuators.Tests
NAMESPACE Simatic.Ax.Actuators.Tests

// {TestFixture}
// CLASS TestTwoWayActuator
// VAR
// o : TwoWayActuator;
// oStateless : TwoWayActuator;
// command : itfCommand;
// END_VAR
{TestFixture}
CLASS TestTwoWayActuator
VAR
o : TwoWayActuator;
oStateless : TwoWayActuator;
command : itfCommand;
END_VAR

// {TestSetup}
// METHOD PUBLIC TestSetup
// o := oStateless;
// o.Init();
// END_METHOD
{TestSetup}
METHOD PUBLIC TestSetup
o := oStateless;
o.Init();
END_METHOD

// {Test}
// METHOD PUBLIC Idle_Actuator_Returns_no_signals
// command := o.GoToWorkPos();
// IF (command = NULL) THEN
// RETURN;
// END_IF;
{Test}
METHOD PUBLIC Idle_Actuator_Returns_no_signals
command := o.GoToWorkPos();
IF (command = NULL) THEN
RETURN;
END_IF;

// Equal(expected := FALSE, actual := command.Done());
// Equal(expected := TRUE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
// Equal(expected := TRUE, actual := o.controlToWorkPos);
// END_METHOD
// Equal(expected := FALSE, actual := command.Done());
// Equal(expected := TRUE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
Equal(expected := TRUE, actual := o.controlToWorkPos);
END_METHOD

// {Test}
// METHOD PUBLIC ToOpenUntilDone
// command := o.GoToWorkPos();
{Test}
METHOD PUBLIC ToOpenUntilDone
command := o.GoToWorkPos();

// Equal(expected := FALSE, actual := command.Done());
// Equal(expected := TRUE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
// Equal(expected := TRUE, actual := o.controlToWorkPos);
// Equal(expected := FALSE, actual := command.Done());
// Equal(expected := TRUE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
Equal(expected := TRUE, actual := o.controlToWorkPos);


// o.feedbackInWorkPos := TRUE;
// command.Busy();
o.feedbackInWorkPos := TRUE;
command.Busy();

// Equal(expected := TRUE, actual := command.Done());
// Equal(expected := FALSE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
// Equal(expected := FALSE, actual := o.controlToWorkPos);
// END_METHOD
// Equal(expected := TRUE, actual := command.Done());
// Equal(expected := FALSE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
// Equal(expected := FALSE, actual := o.controlToWorkPos);
END_METHOD

// {Test}
// METHOD PUBLIC Test_Open_close_Sequence
// command := o.GoToWorkPos();
{Test}
METHOD PUBLIC Test_Open_close_Sequence
command := o.GoToWorkPos();

// IF (command = NULL) THEN
// RETURN;
IF (command = NULL) THEN
RETURN;

// END_IF;
END_IF;

// Equal(expected := FALSE, actual := command.Done());
// Equal(expected := TRUE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
// Equal(expected := TRUE, actual := o.controlToWorkPos);
// END_METHOD
// Equal(expected := FALSE, actual := command.Done());
// Equal(expected := TRUE, actual := command.Busy());
// Equal(expected := FALSE, actual := command.Error());
Equal(expected := TRUE, actual := o.controlToWorkPos);
END_METHOD

// END_CLASS
END_CLASS

// END_NAMESPACE
END_NAMESPACE

0 comments on commit 60f66b4

Please sign in to comment.