From b3b1d95cda63fb97ad2ae0631edb1cfbd9840ed8 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 16 Jul 2019 23:33:53 +0100 Subject: [PATCH] Unit tests for Tracking property --- .../TelescopeUnitTests.cs | 17 +++++++++++++++++ Meade.net.Telescope/Telescope.cs | 1 + 2 files changed, 18 insertions(+) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index ab017f5..a7282be 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -1616,5 +1616,22 @@ namespace Meade.net.Telescope.UnitTests Assert.That(result, Is.EqualTo(rightAscension)); } + + [Test] + public void Tracking_Get_WhenDefault_ThenIsTrue() + { + Assert.That(_telescope.Tracking, Is.True); + } + + [TestCase(true)] + [TestCase(false)] + public void Tracking_SetAndGet_WhenValueSet_ThenCanGetNewValue(bool tracking) + { + _telescope.Tracking = tracking; + + Assert.That(_telescope.Tracking, Is.EqualTo( tracking)); + } + + } } diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 5169308..a79b7c4 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -311,6 +311,7 @@ namespace ASCOM.Meade.net _userNewerPulseGuiding = IsNewPulseGuidingSupported(); _targetDeclination = INVALID_PARAMETER; _targetRightAscension = INVALID_PARAMETER; + _tracking = true; LogMessage("Connected Set", $"New Pulse Guiding Supported: {_userNewerPulseGuiding}"); IsConnected = true;