Added unit test to make sure that the LX200GPS with german firmware works as expected.
This commit is contained in:
@@ -791,12 +791,12 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Get"));
|
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Get"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)]
|
[TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)]
|
||||||
[TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)]
|
[TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)]
|
||||||
[TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
|
[TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
|
||||||
[TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
|
[TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
|
||||||
[TestCase("G", AlignmentModes.algGermanPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
|
[TestCase("G", AlignmentModes.algGermanPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)]
|
||||||
|
[TestCase("P", AlignmentModes.algPolar, TelescopeList.LX200GPS, TelescopeList.LX200GPS_4G0M)]
|
||||||
public void AlignmentMode_Get_WhenScopeInAltAz_ReturnsAltAz(string telescopeMode, AlignmentModes alignmentMode, string productName, string firmware)
|
public void AlignmentMode_Get_WhenScopeInAltAz_ReturnsAltAz(string telescopeMode, AlignmentModes alignmentMode, string productName, string firmware)
|
||||||
{
|
{
|
||||||
_testProperties.AlignmentMode = telescopeMode;
|
_testProperties.AlignmentMode = telescopeMode;
|
||||||
|
|||||||
@@ -1102,7 +1102,7 @@ namespace ASCOM.Meade.net
|
|||||||
LogMessage("AlignmentMode Get", $"Sending Ack code.");
|
LogMessage("AlignmentMode Get", $"Sending Ack code.");
|
||||||
var alignmentString = GetAlignmentString();
|
var alignmentString = GetAlignmentString();
|
||||||
AlignmentModes alignmentMode;
|
AlignmentModes alignmentMode;
|
||||||
switch (alignmentString)
|
switch (alignmentString.ToUpperInvariant())
|
||||||
{
|
{
|
||||||
case "A":
|
case "A":
|
||||||
LogMessage("AlignmentMode Get", $"Telescope is in AltAz");
|
LogMessage("AlignmentMode Get", $"Telescope is in AltAz");
|
||||||
@@ -1116,9 +1116,10 @@ namespace ASCOM.Meade.net
|
|||||||
LogMessage("AlignmentMode Get", $"Telescope is in Land mode");
|
LogMessage("AlignmentMode Get", $"Telescope is in Land mode");
|
||||||
alignmentMode = AlignmentModes.algAltAz;
|
alignmentMode = AlignmentModes.algAltAz;
|
||||||
break;
|
break;
|
||||||
//case "G":
|
case "G":
|
||||||
//alignmentMode = AlignmentModes.algGermanPolar;
|
LogMessage("AlignmentMode Get", $"Telescope is in German Polar mode");
|
||||||
//break;
|
alignmentMode = AlignmentModes.algGermanPolar;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
var msg = $"unknown alignment returned from telescope: {alignmentString}";
|
var msg = $"unknown alignment returned from telescope: {alignmentString}";
|
||||||
LogMessage("AlignmentMode Get", msg);
|
LogMessage("AlignmentMode Get", msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user