diff --git a/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs b/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs index c47b9ef..dd5ec24 100644 --- a/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs +++ b/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO.Ports; using ASCOM; +using ASCOM.DeviceInterface; using ASCOM.MeadeAutostar497.Controller; using Moq; using NUnit.Framework; @@ -384,8 +385,6 @@ namespace MeadeAutostar497.UnitTests Assert.That(exception.Message, Is.EqualTo("Failed to set site longitude.")); } - - [Test] public void SiteLongitude_Set_NoErrorWhenValidValueSentSuccessfully() { @@ -397,5 +396,53 @@ namespace MeadeAutostar497.UnitTests _telescopeController.SiteLongitude = 10; } + + [Test] + public void PulseGuideEast() + { + _isConnected = true; + + _telescopeController.Connected = true; + + _telescopeController.PulseGuide(GuideDirections.guideEast,100); + + serialMock.Verify( x => x.Command(":Mge0100#"), Times.Once); + } + + [Test] + public void PulseGuideWest() + { + _isConnected = true; + + _telescopeController.Connected = true; + + _telescopeController.PulseGuide(GuideDirections.guideWest, 1200); + + serialMock.Verify(x => x.Command(":Mgw1200#"), Times.Once); + } + + [Test] + public void PulseGuideNorth() + { + _isConnected = true; + + _telescopeController.Connected = true; + + _telescopeController.PulseGuide(GuideDirections.guideNorth, 256); + + serialMock.Verify(x => x.Command(":Mgn0256#"), Times.Once); + } + + [Test] + public void PulseGuideSouth() + { + _isConnected = true; + + _telescopeController.Connected = true; + + _telescopeController.PulseGuide(GuideDirections.guideSouth, 1024); + + serialMock.Verify(x => x.Command(":Mgs1024#"), Times.Once); + } } } diff --git a/MeadeAutostar497/Controller/TelescopeController.cs b/MeadeAutostar497/Controller/TelescopeController.cs index 76569ae..8fd7d7c 100644 --- a/MeadeAutostar497/Controller/TelescopeController.cs +++ b/MeadeAutostar497/Controller/TelescopeController.cs @@ -275,7 +275,7 @@ namespace ASCOM.MeadeAutostar497.Controller if (UserNewerPulseGuiding) { _serialPort.Command($":Mg{d}{duration:0000}#"); - Thread.Sleep(duration); + Thread.Sleep(duration); //todo figure out if this is really needed } else {