From e8793231d1eaed86c13c8377053c82b4cae9565d Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 2 May 2019 18:54:52 +0100 Subject: [PATCH] Fixed broken unit test --- .../TelescopeControllerUnitTests.cs | 11 ++++++----- MeadeAutostar497/Controller/TelescopeController.cs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs b/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs index a52d946..97f4fcf 100644 --- a/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs +++ b/MeadeAutostar497.UnitTests/TelescopeControllerUnitTests.cs @@ -448,12 +448,13 @@ namespace MeadeAutostar497.UnitTests serialMock.Verify(x => x.Command(":Mgs1024#"), Times.Once); } - [TestCase("AT0", AlignmentModes.algAltAz)] - [TestCase("PT0", AlignmentModes.algPolar)] - [TestCase("GT0", AlignmentModes.algGermanPolar)] - public void AlignmentMode_Get_ReturnsExpectedValue(string commandResponse, AlignmentModes mode) + [TestCase('A', AlignmentModes.algAltAz)] + [TestCase('P', AlignmentModes.algPolar)] + public void AlignmentMode_Get_ReturnsExpectedValue(char commandResponse, AlignmentModes mode) { - serialMock.Setup(x => x.CommandTerminated(":GW#", "#")).Returns(commandResponse); + const char ack = (char)6; + + serialMock.Setup(x => x.CommandChar(ack.ToString())).Returns(commandResponse); _isConnected = true; diff --git a/MeadeAutostar497/Controller/TelescopeController.cs b/MeadeAutostar497/Controller/TelescopeController.cs index e5d1d13..da3234b 100644 --- a/MeadeAutostar497/Controller/TelescopeController.cs +++ b/MeadeAutostar497/Controller/TelescopeController.cs @@ -262,7 +262,7 @@ namespace ASCOM.MeadeAutostar497.Controller { get { - char ack = (char)6; + const char ack = (char)6; //var alignmentString = SerialPort.CommandTerminated(":GW#", "#"); var alignmentString = SerialPort.CommandChar(ack.ToString()); //:GW# Get Scope Alignment Status