Skip to content

Commit

Permalink
enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuergen committed Oct 11, 2024
1 parent 5d65b3f commit 07f16f3
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions test/TwoWayActuatorTest.st
Original file line number Diff line number Diff line change
Expand Up @@ -62,62 +62,62 @@ NAMESPACE Simatic.Ax.axftcmlib
Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InWorkPosition);
END_METHOD

// {Test}
// METHOD PUBLIC Reaching_WorkPosition_Switches_Q_ToWorkPosition_Off_And_Returns_Done
// THIS.GoToWorkPosition_Swiches_Q_ToWorkPosition_On_And_Returns_Busy();
// _iInWorkPos.ReadCyclic(signal := TRUE);
// busy := cmd.Busy();
// IF NOT(busy) THEN
// done := cmd.Done();
// END_IF;
// AxUnit.Assert.Equal(expected := FALSE, actual := busy);
// AxUnit.Assert.Equal(expected := TRUE, actual := done);
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToHome.IsOn());
// Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InWorkPosition);
// END_METHOD
{Test}
METHOD PUBLIC Reaching_WorkPosition_Switches_Q_ToWorkPosition_Off_And_Returns_Done
THIS.GoToWorkPosition_Swiches_Q_ToWorkPosition_On_And_Returns_Busy();
_iInWorkPos.ReadCyclic(signal := TRUE);
busy := cmd.Busy();
IF NOT(busy) THEN
done := cmd.Done();
END_IF;
AxUnit.Assert.Equal(expected := FALSE, actual := busy);
AxUnit.Assert.Equal(expected := TRUE, actual := done);
AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
AxUnit.Assert.Equal(expected := FALSE, actual := _qToHome.IsOn());
Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InWorkPosition);
END_METHOD


// // Test Home Position
// {Test}
// METHOD PUBLIC GoToHomePosition_Swiches_Q_ToHomePosition_On_And_Returns_Busy
// cmd := _actuator.GoToHomePosition();
// busy := cmd.Busy();
// AxUnit.Assert.Equal(expected := TRUE, actual := busy);
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
// AxUnit.Assert.Equal(expected := TRUE, actual := _qToHome.IsOn());
// Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#MoveToHomePosition);
// END_METHOD
// Test Home Position
{Test}
METHOD PUBLIC GoToHomePosition_Swiches_Q_ToHomePosition_On_And_Returns_Busy
cmd := _actuator.GoToHomePosition();
busy := cmd.Busy();
AxUnit.Assert.Equal(expected := FALSE, actual := busy);
AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
AxUnit.Assert.Equal(expected := TRUE, actual := _qToHome.IsOn());
Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#MoveToHomePosition);
END_METHOD

// {Test}
// METHOD PUBLIC GoToHomePosition_Returns_Done_When_end_position_is_already_reached
// _iInHomePos.ReadCyclic(signal := TRUE);
// cmd := _actuator.GoToHomePosition();
// busy := cmd.Busy();
// IF NOT(busy) THEN
// done := cmd.Done();
// END_IF;
// AxUnit.Assert.Equal(expected := FALSE, actual := busy);
// AxUnit.Assert.Equal(expected := TRUE, actual := done);
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToHome.IsOn());
// Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InHomePosition);
// END_METHOD
{Test}
METHOD PUBLIC GoToHomePosition_Returns_Done_When_end_position_is_already_reached
_iInHomePos.ReadCyclic(signal := TRUE);
cmd := _actuator.GoToHomePosition();
busy := cmd.Busy();
IF NOT(busy) THEN
done := cmd.Done();
END_IF;
AxUnit.Assert.Equal(expected := FALSE, actual := busy);
AxUnit.Assert.Equal(expected := TRUE, actual := done);
AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
AxUnit.Assert.Equal(expected := FALSE, actual := _qToHome.IsOn());
Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InHomePosition);
END_METHOD

// {Test}
// METHOD PUBLIC Reaching_HomePosition_Switches_Q_ToHomePosition_Off_And_Returns_Done
// THIS.GoToHomePosition_Swiches_Q_ToHomePosition_On_And_Returns_Busy();
// _iInHomePos.ReadCyclic(signal := TRUE);
// busy := cmd.Busy();
// IF NOT(busy) THEN
// done := cmd.Done();
// END_IF;
// AxUnit.Assert.Equal(expected := FALSE, actual := busy);
// AxUnit.Assert.Equal(expected := TRUE, actual := done);
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
// AxUnit.Assert.Equal(expected := FALSE, actual := _qToHome.IsOn());
// Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InHomePosition);
// END_METHOD
{Test}
METHOD PUBLIC Reaching_HomePosition_Switches_Q_ToHomePosition_Off_And_Returns_Done
THIS.GoToHomePosition_Swiches_Q_ToHomePosition_On_And_Returns_Busy();
_iInHomePos.ReadCyclic(signal := TRUE);
busy := cmd.Busy();
IF NOT(busy) THEN
done := cmd.Done();
END_IF;
AxUnit.Assert.Equal(expected := TRUE, actual := busy);
AxUnit.Assert.Equal(expected := TRUE, actual := done);
AxUnit.Assert.Equal(expected := FALSE, actual := _qToWork.IsOn());
AxUnit.Assert.Equal(expected := FALSE, actual := _qToHome.IsOn());
Equal(expected := TRUE, actual := _actuator.GetState() = ActuatorState#InHomePosition);
END_METHOD
END_CLASS

END_NAMESPACE

0 comments on commit 07f16f3

Please sign in to comment.