diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 9cd4e95..713b2b0 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2702,7 +2702,10 @@ namespace Meade.net.Telescope.UnitTests [TestCase(DriveRates.driveLunar, "TL")] public void TrackingRate_Set_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string commandString) { - ConnectTelescope(); + string productName = TelescopeList.Autostar497; + string firmwareVersion = TelescopeList.Autostar497_43Eg; + + ConnectTelescope(productName, firmwareVersion); _telescope.TrackingRate = rate; @@ -2715,7 +2718,10 @@ namespace Meade.net.Telescope.UnitTests [Test] public void TrackingRate_Set_WhenUnSupportedRateSet_ThenThrowsException() { - ConnectTelescope(); + string productName = TelescopeList.Autostar497; + string firmwareVersion = TelescopeList.Autostar497_43Eg; + + ConnectTelescope(productName, firmwareVersion); var exception = Assert.Throws(() => _telescope.TrackingRate = DriveRates.driveKing); @@ -2736,7 +2742,10 @@ namespace Meade.net.Telescope.UnitTests [TestCase(DriveRates.driveLunar)] public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate) { - ConnectTelescope(); + string productName = TelescopeList.Autostar497; + string firmwareVersion = TelescopeList.Autostar497_43Eg; + + ConnectTelescope(productName, firmwareVersion); _telescope.TrackingRate = rate; @@ -2745,6 +2754,20 @@ namespace Meade.net.Telescope.UnitTests Assert.That(result, Is.EqualTo(rate)); } + [TestCase(DriveRates.driveSidereal)] + [TestCase(DriveRates.driveLunar)] + public void TrackingRate_Set_WhenConnectedToLX200_ThenThrowsException(DriveRates rate) + { + string productName = TelescopeList.LX200CLASSIC; + string firmwareVersion = string.Empty; + + ConnectTelescope(productName, firmwareVersion); + + var result = Assert.Throws( () => _telescope.TrackingRate = rate ); + + Assert.That(result.Message, Is.EqualTo("TrackingRate Set is not implemented in this driver.")); + } + [Test] public void TrackingRates_Get_ReturnsExpectedType() { diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 2489c6a..a694f31 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -2649,6 +2649,11 @@ namespace ASCOM.Meade.net CheckConnected("TrackingRate Set"); CheckParked(); + if (SharedResourcesWrapper.ProductName == TelescopeList.LX200CLASSIC) + { + throw new ASCOM.NotImplementedException("TrackingRate Set"); + } + switch (value) { case DriveRates.driveSidereal: