Modified unit tests for force a pass.

This commit is contained in:
2022-11-10 14:58:12 +00:00
parent e93da73431
commit 5c3bb7d4ad
@@ -2517,6 +2517,7 @@ namespace Meade.net.Telescope.UnitTests
public void TargetRightAscension_Set_WhenTelescopeReportsInvalidRA_ThenThrowsException()
{
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
@@ -3113,6 +3114,8 @@ namespace Meade.net.Telescope.UnitTests
[Test]
public void SlewToTargetAsync_WhenTargetDeclinationNotSet_ThenThrowsException()
{
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
_telescope.TargetRightAscension = 1;
@@ -3135,6 +3138,8 @@ namespace Meade.net.Telescope.UnitTests
[Test]
public void SlewToTargetAsync_WhenTargetSet_ThenAttemptsSlew()
{
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
_telescope.TargetRightAscension = 2;
@@ -3149,6 +3154,8 @@ namespace Meade.net.Telescope.UnitTests
{
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
_telescope.TargetRightAscension = 2;
@@ -3166,6 +3173,8 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("1");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
_telescope.TargetRightAscension = 2;
@@ -3181,6 +3190,8 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("2");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
_telescope.TargetRightAscension = 2;
@@ -3196,6 +3207,8 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("3");
_sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod");
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
ConnectTelescope();
_telescope.TargetRightAscension = 2;
@@ -3220,6 +3233,9 @@ namespace Meade.net.Telescope.UnitTests
var preTestItterations = 1;
var slewCounter = 0;
var iterations = 10;
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
_sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() =>
{
slewCounter++;