Added support for can get guide rates for the LX200GPS
This commit is contained in:
@@ -163,7 +163,7 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
|
|
||||||
var exception = Assert.Throws<InvalidValueException>(() => { _telescope.Action("site", site); });
|
var exception = Assert.Throws<InvalidValueException>(() => { _telescope.Action("site", site); });
|
||||||
|
|
||||||
Assert.That(exception.Message, Is.EqualTo($"Site {site} not allowed must be between 1 and 4"));
|
Assert.That(exception.Message, Is.EqualTo($"Site {site} not allowed, must be between 1 and 4"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -618,13 +618,34 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void CanSetGuideRates_Get_ReturnsFalse()
|
public void CanSetGuideRates_Get_WhenNotConnected_ThenThrowsException()
|
||||||
{
|
{
|
||||||
|
var exception = Assert.Throws<NotConnectedException>(() => { var result = _telescope.CanSetGuideRates; });
|
||||||
|
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: CanSetGuideRates Get"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void CanSetGuideRates_Get_WhenConnectedToAutostar_ThenReturnsFalse()
|
||||||
|
{
|
||||||
|
ConnectTelescope();
|
||||||
|
|
||||||
var result = _telescope.CanSetGuideRates;
|
var result = _telescope.CanSetGuideRates;
|
||||||
|
|
||||||
Assert.That(result, Is.False);
|
Assert.That(result, Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void CanSetGuideRates_Get_WhenConnectedToLX200GPS_ThenReturnsTrue()
|
||||||
|
{
|
||||||
|
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.LX200GPS);
|
||||||
|
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.LX200GPS_42G);
|
||||||
|
_telescope.Connected = true;
|
||||||
|
|
||||||
|
var result = _telescope.CanSetGuideRates;
|
||||||
|
|
||||||
|
Assert.That(result, Is.True);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void CanSetPark_Get_ReturnsFalse()
|
public void CanSetPark_Get_ReturnsFalse()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ namespace ASCOM.Meade.net
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
LogMessage("", "Action {0}, parameters {1} not implemented", actionName, actionParameters);
|
||||||
throw new InvalidValueException($"Site {actionParameters} not allowed must be between 1 and 4");
|
throw new InvalidValueException($"Site {actionParameters} not allowed, must be between 1 and 4");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,8 +755,12 @@ namespace ASCOM.Meade.net
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
LogMessage("CanSetGuideRates", "Get - " + false.ToString());
|
CheckConnected("CanSetGuideRates Get");
|
||||||
return false;
|
|
||||||
|
var canSetGuideRate = IsGuideRateSettingSupported();
|
||||||
|
|
||||||
|
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate.ToString());
|
||||||
|
return canSetGuideRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user