Added unit test for telescope hitting tripod.

This commit is contained in:
2020-05-24 16:40:47 +01:00
parent 1e59d5610e
commit 2c7de157e8
@@ -2291,6 +2291,21 @@ namespace Meade.net.Telescope.UnitTests
Assert.That(exception.Message, Is.EqualTo("Above below elevation"));
}
[Test]
public void SlewToTargetAsync_WhenTelescopeCanHitTripod_ThenThrowsException()
{
_sharedResourcesWrapperMock.Setup(x => x.SendChar("#:MS#")).Returns("3");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod");
ConnectTelescope();
_telescope.TargetRightAscension = 2;
_telescope.TargetDeclination = 1;
var exception = Assert.Throws<InvalidOperationException>(() => { _telescope.SlewToTargetAsync(); });
Assert.That(exception.Message, Is.EqualTo("the telescope can hit the tripod"));
}
[Test]
public void SlewToTarget_WhenNotConnected_ThenThrowsException()
{