diff --git a/mRemoteNGTests/App/UpdaterTests.cs b/mRemoteNGTests/App/UpdaterTests.cs index c4c01c7a0..80ee0914c 100644 --- a/mRemoteNGTests/App/UpdaterTests.cs +++ b/mRemoteNGTests/App/UpdaterTests.cs @@ -9,75 +9,59 @@ namespace mRemoteNGTests.App; [TestFixture] public class UpdaterTests { + private readonly Version TestApplicationVersion = new("1.0.0.0"); + [Test] public void UpdateStableChannel() { - GeneralAppInfo.ApplicationVersion = "1.0.0.0"; var CurrentUpdateInfo = UpdateInfo.FromString(Resources.update); Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True); - Version v; - Version.TryParse(GeneralAppInfo.ApplicationVersion, out v); - var IsNewer = CurrentUpdateInfo.Version > v; + bool IsNewer = CurrentUpdateInfo.Version > TestApplicationVersion; Assert.That(IsNewer, Is.True); } [Test] public void UpdateBetaChannel() { - GeneralAppInfo.ApplicationVersion = "1.0.0.0"; var CurrentUpdateInfo = UpdateInfo.FromString(Resources.beta_update); Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True); - Version v; - Version.TryParse(GeneralAppInfo.ApplicationVersion, out v); - var IsNewer = CurrentUpdateInfo.Version > v; + bool IsNewer = CurrentUpdateInfo.Version > TestApplicationVersion; Assert.That(IsNewer, Is.True); } [Test] public void UpdateDevChannel() { - GeneralAppInfo.ApplicationVersion = "1.0.0.0"; var CurrentUpdateInfo = UpdateInfo.FromString(Resources.dev_update); Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True); - Version v; - Version.TryParse(GeneralAppInfo.ApplicationVersion, out v); - var IsNewer = CurrentUpdateInfo.Version > v; + bool IsNewer = CurrentUpdateInfo.Version > TestApplicationVersion; Assert.That(IsNewer, Is.True); } [Test] public void UpdateStablePortableChannel() { - GeneralAppInfo.ApplicationVersion = "1.0.0.0"; var CurrentUpdateInfo = UpdateInfo.FromString(Resources.update_portable); Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True); - Version v; - Version.TryParse(GeneralAppInfo.ApplicationVersion, out v); - var IsNewer = CurrentUpdateInfo.Version > v; + bool IsNewer = CurrentUpdateInfo.Version > TestApplicationVersion; Assert.That(IsNewer, Is.True); } [Test] public void UpdateBetaPortableChannel() { - GeneralAppInfo.ApplicationVersion = "1.0.0.0"; var CurrentUpdateInfo = UpdateInfo.FromString(Resources.beta_update_portable); Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True); - Version v; - Version.TryParse(GeneralAppInfo.ApplicationVersion, out v); - var IsNewer = CurrentUpdateInfo.Version > v; + bool IsNewer = CurrentUpdateInfo.Version > TestApplicationVersion; Assert.That(IsNewer, Is.True); } [Test] public void UpdateDevPortableChannel() { - GeneralAppInfo.ApplicationVersion = "1.0.0.0"; var CurrentUpdateInfo = UpdateInfo.FromString(Resources.dev_update_portable); Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True); - Version v; - Version.TryParse(GeneralAppInfo.ApplicationVersion, out v); - var IsNewer = CurrentUpdateInfo.Version > v; + bool IsNewer = CurrentUpdateInfo.Version > TestApplicationVersion; Assert.That(IsNewer, Is.True); } } \ No newline at end of file