Added support for AlignmentMode

This commit is contained in:
2019-05-02 14:05:23 +01:00
parent d2fae7607b
commit 7225c2d70f
4 changed files with 77 additions and 1 deletions
@@ -444,5 +444,35 @@ namespace MeadeAutostar497.UnitTests
serialMock.Verify(x => x.Command(":Mgs1024#"), Times.Once);
}
[TestCase("AT0", AlignmentModes.algAltAz)]
[TestCase("PT0", AlignmentModes.algPolar)]
[TestCase("GT0", AlignmentModes.algGermanPolar)]
public void AlignmentMode_Get_ReturnsExpectedValue(string commandResponse, AlignmentModes mode)
{
serialMock.Setup(x => x.CommandTerminated(":GW#", "#")).Returns(commandResponse);
_isConnected = true;
_telescopeController.Connected = true;
var result = _telescopeController.AlignmentMode;
Assert.That(result, Is.EqualTo(mode));
}
[TestCase(AlignmentModes.algAltAz, ":AA#")]
[TestCase(AlignmentModes.algPolar, ":AP#")]
[TestCase(AlignmentModes.algGermanPolar, ":AP#")]
public void AligmentMode_Set_WorksAsExpected(AlignmentModes mode, string command)
{
_isConnected = true;
_telescopeController.Connected = true;
_telescopeController.AlignmentMode = mode;
serialMock.Verify( x => x.Command(command), Times.Once);
}
}
}