public void ParkDome() { _svc.MockAtPark = false; _svc.MockAzimuth = 90.0; _mgr.ParkTheDome(); Thread.Sleep(100); Assert.IsTrue(_mgr.Status.Slewing, "The dome has not started slewing to Park!"); while (_mgr.Status.Slewing) { Thread.Sleep(100); } Assert.IsFalse(_mgr.Status.Slewing); Assert.IsTrue(_mgr.Status.AtPark); Assert.AreEqual(_svc.ParkAzimuth, _mgr.Azimuth); }
public void ParkDome() { _svc.MockAtPark = false; _svc.MockAzimuth = 90.0; _mgr.ParkTheDome(); Assert.IsTrue(_mgr.Status.Slewing, "The dome has not started slewing to Park."); DateTime timeoutTime = DateTime.Now.AddMinutes(1.0); bool timedout = false; DevHubDomeStatus sts = _mgr.Status; while (!timedout) { if (!_mgr.Status.Slewing && _mgr.Status.AtPark) { break; } else { if (DateTime.Now > timeoutTime) { timedout = true; } else { Thread.Sleep(500); sts = _mgr.Status; } } } Assert.IsFalse(timedout); Assert.IsFalse(_mgr.Status.Slewing); Assert.IsTrue(sts.AtPark); Assert.AreEqual(_svc.ParkAzimuth, _mgr.Status.Azimuth); }