From 183ddc42bac7a533376216ee9ff2200aa14ee219 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Wed, 4 Nov 2026 09:56:59 +0000 Subject: [PATCH] Upgraded all projects to use .netframework 4.8 --- .../Meade.net.Telescope.UnitTests.csproj | 6 +-- .../TelescopeUnitTests.cs | 37 +++++++++---------- Meade.net.Telescope.UnitTests/app.config | 12 +++--- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj b/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj index 038eaf3..10cd1c5 100644 --- a/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj +++ b/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj @@ -14,7 +14,7 @@ Properties Meade.net.Telescope.UnitTests Meade.net.Telescope.UnitTests - v4.7.2 + v4.8 512 true @@ -60,9 +60,9 @@ MinimumRecommendedRules.ruleset - bin\$(Platform)\$(Configuration)\ + bin\$(Platform)\$(Configuration)\ - + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 912ffb8..abea709 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -13,7 +13,6 @@ using ASCOM.Meade.net.Wrapper; using ASCOM.Utilities.Interfaces; using Moq; using NUnit.Framework; -using InvalidOperationException = ASCOM.InvalidOperationException; namespace Meade.net.Telescope.UnitTests { @@ -1373,7 +1372,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); // when - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => { var result = _telescope.SiderealTime; Assert.Fail($"{result} should not have returned"); @@ -1761,7 +1760,7 @@ namespace Meade.net.Telescope.UnitTests var duration = 0; ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.PulseGuide(direction, duration)); + var exception = Assert.Throws(() => _telescope.PulseGuide(direction, duration)); Assert.That(exception.Message, Is.EqualTo("Unable to PulseGuide whilst slewing to target.")); } @@ -1778,7 +1777,7 @@ namespace Meade.net.Telescope.UnitTests var duration = 1; ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.PulseGuide(direction, duration)); + var exception = Assert.Throws(() => _telescope.PulseGuide(direction, duration)); Assert.That(exception.Message, Is.EqualTo("Unable to PulseGuide whilst in AltAz mode.")); } @@ -1799,7 +1798,7 @@ namespace Meade.net.Telescope.UnitTests _telescope.MoveAxis(axes, 1); - var exception = Assert.Throws(() => _telescope.PulseGuide(direction, duration)); + var exception = Assert.Throws(() => _telescope.PulseGuide(direction, duration)); Assert.That(exception.Message, Is.EqualTo("Unable to PulseGuide while moving same axis.")); Assert.That(_sharedResourcesWrapperMock.Object.MovingPrimary, Is.EqualTo(axes == TelescopeAxes.axisPrimary)); @@ -2216,7 +2215,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.SiteLatitude = siteLatitude); + var exception = Assert.Throws(() => _telescope.SiteLatitude = siteLatitude); Assert.That(exception.Message, Is.EqualTo("Failed to set site latitude.")); } @@ -2297,7 +2296,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.SiteLongitude = 10); + var exception = Assert.Throws(() => _telescope.SiteLongitude = 10); Assert.That(exception.Message, Is.EqualTo("Failed to set site longitude.")); } @@ -2337,7 +2336,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.SyncToTarget()); + var exception = Assert.Throws(() => _telescope.SyncToTarget()); Assert.That(exception.Message, Is.EqualTo("Unable to perform sync")); _sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "CM", false), Times.Once); @@ -2390,7 +2389,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.TargetDeclination = 50); + var exception = Assert.Throws(() => _telescope.TargetDeclination = 50); Assert.That(exception.Message, Is.EqualTo("Target declination invalid")); } @@ -2416,7 +2415,7 @@ namespace Meade.net.Telescope.UnitTests { ConnectTelescope(); - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => { var result = _telescope.TargetDeclination; Assert.Fail($"{result} should not have returned"); @@ -2519,7 +2518,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.TargetRightAscension = 1); + var exception = Assert.Throws(() => _telescope.TargetRightAscension = 1); Assert.That(exception.Message, Is.EqualTo("Failed to set TargetRightAscension.")); } @@ -2542,7 +2541,7 @@ namespace Meade.net.Telescope.UnitTests { ConnectTelescope(); - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => { var result = _telescope.TargetRightAscension; Assert.Fail($"{result} should not have returned"); @@ -2830,7 +2829,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.UTCDate = newDate); + var exception = Assert.Throws(() => _telescope.UTCDate = newDate); Assert.That(exception.Message, Is.EqualTo("Failed to set local time")); } @@ -2850,7 +2849,7 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - var exception = Assert.Throws(() => _telescope.UTCDate = newDate); + var exception = Assert.Throws(() => _telescope.UTCDate = newDate); Assert.That(exception.Message, Is.EqualTo("Failed to set local date")); } @@ -3170,7 +3169,7 @@ namespace Meade.net.Telescope.UnitTests _telescope.TargetRightAscension = 1; - var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); + var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); Assert.That(exception.Message, Is.EqualTo("Target not set")); } @@ -3184,7 +3183,7 @@ namespace Meade.net.Telescope.UnitTests _telescope.TargetDeclination = 1; - var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); + var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); Assert.That(exception.Message, Is.EqualTo("Target not set")); } @@ -3239,7 +3238,7 @@ namespace Meade.net.Telescope.UnitTests _telescope.TargetRightAscension = 2; _telescope.TargetDeclination = 1; - var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); + var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); Assert.That(exception.Message, Is.EqualTo("Below horizon")); } @@ -3259,7 +3258,7 @@ namespace Meade.net.Telescope.UnitTests _telescope.TargetRightAscension = 2; _telescope.TargetDeclination = 1; - var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); + var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); Assert.That(exception.Message, Is.EqualTo("Above below elevation")); } @@ -3278,7 +3277,7 @@ namespace Meade.net.Telescope.UnitTests _telescope.TargetRightAscension = 2; _telescope.TargetDeclination = 1; - var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); + var exception = Assert.Throws(() => _telescope.SlewToTargetAsync()); Assert.That(exception.Message, Is.EqualTo("the telescope can hit the tripod")); } diff --git a/Meade.net.Telescope.UnitTests/app.config b/Meade.net.Telescope.UnitTests/app.config index 134bd4d..561bc63 100644 --- a/Meade.net.Telescope.UnitTests/app.config +++ b/Meade.net.Telescope.UnitTests/app.config @@ -1,15 +1,15 @@ - + - - + + - - + + - +