Modified the precision toggle to only use the first letter of the response rather than try to detect the entire string

This commit is contained in:
2019-08-18 22:43:38 +01:00
parent f10936a9e8
commit f6556716a5
2 changed files with 8 additions and 7 deletions
@@ -752,23 +752,23 @@ namespace Meade.net.Telescope.UnitTests
_profileProperties.Precision = desiredPresision;
var currentPrecision = telescopePrecision;
_sharedResourcesWrapperMock.Setup(x => x.SendString(":P#")).Returns(() =>
_sharedResourcesWrapperMock.Setup(x => x.SendChar(":P#")).Returns(() =>
{
currentPrecision = !currentPrecision;
switch (currentPrecision)
{
case true:
return "HIGH PRECISION";
return "H";
default:
return "LOW PRECISION";
return "L";
}
});
_telescope.Connected = true;
Assert.That(currentPrecision, Is.EqualTo(finalPrecision));
_sharedResourcesWrapperMock.Verify(x => x.SendString(":P#"), Times.AtLeastOnce);
_sharedResourcesWrapperMock.Verify(x => x.SendChar(":P#"), Times.AtLeastOnce);
}
[Test]