Added support for can get guide rates for the LX200GPS

This commit is contained in:
2019-07-21 17:49:28 +01:00
parent 6b9eff2b86
commit c4eb74b274
2 changed files with 30 additions and 5 deletions
@@ -163,7 +163,7 @@ namespace Meade.net.Telescope.UnitTests
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]
@@ -618,13 +618,34 @@ namespace Meade.net.Telescope.UnitTests
}
[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;
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]
public void CanSetPark_Get_ReturnsFalse()
{
+7 -3
View File
@@ -253,7 +253,7 @@ namespace ASCOM.Meade.net
break;
default:
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
{
LogMessage("CanSetGuideRates", "Get - " + false.ToString());
return false;
CheckConnected("CanSetGuideRates Get");
var canSetGuideRate = IsGuideRateSettingSupported();
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate.ToString());
return canSetGuideRate;
}
}