Initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using RobotNet10.GlobalPathPlanner.Model;
|
||||
|
||||
namespace RobotNet10.GlobalPathPlanner.UnitTest;
|
||||
|
||||
public class OrientationTests
|
||||
{
|
||||
[Fact]
|
||||
public void Orientation_EnumValues_ShouldBeDefined()
|
||||
{
|
||||
// Act & Assert
|
||||
Assert.Equal(0, (int)Orientation.FORWARD);
|
||||
Assert.Equal(1, (int)Orientation.BACKWARD);
|
||||
Assert.Equal(2, (int)Orientation.NONE);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Orientation_AllValues_ShouldExist()
|
||||
{
|
||||
// Act & Assert
|
||||
var values = Enum.GetValues<Orientation>();
|
||||
|
||||
Assert.Contains(Orientation.FORWARD, values);
|
||||
Assert.Contains(Orientation.BACKWARD, values);
|
||||
Assert.Contains(Orientation.NONE, values);
|
||||
Assert.Equal(3, values.Length);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Orientation_CanBeAssignedToNode()
|
||||
{
|
||||
// Arrange
|
||||
var node = new GlobalNode();
|
||||
|
||||
// Act
|
||||
node.Orientation = Orientation.FORWARD;
|
||||
Assert.Equal(Orientation.FORWARD, node.Orientation);
|
||||
|
||||
node.Orientation = Orientation.BACKWARD;
|
||||
Assert.Equal(Orientation.BACKWARD, node.Orientation);
|
||||
|
||||
node.Orientation = Orientation.NONE;
|
||||
Assert.Equal(Orientation.NONE, node.Orientation);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user