mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Add Beta and Dev tests
This commit is contained in:
@@ -8,14 +8,6 @@ namespace mRemoteNGTests.App
|
||||
[TestFixture]
|
||||
public class UpdaterTests
|
||||
{
|
||||
/*
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
GeneralAppInfo.ApplicationVersion = "1.0.0.0";
|
||||
}
|
||||
*/
|
||||
|
||||
[Test]
|
||||
public void UpdateStableChannel()
|
||||
{
|
||||
@@ -31,5 +23,37 @@ namespace mRemoteNGTests.App
|
||||
var IsNewer = CurrentUpdateInfo.Version > v;
|
||||
Assert.That(IsNewer, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UpdateBetaChannel()
|
||||
{
|
||||
GeneralAppInfo.ApplicationVersion = "1.0.0.0";
|
||||
var _upd = new AppUpdater();
|
||||
var e = _upd.DownloadString(UpdateChannelInfo.GetUpdateChannelInfo(UpdateChannelInfo.BETA));
|
||||
Assert.That(e.Cancelled, Is.False);
|
||||
Assert.That(e.Error, Is.Null);
|
||||
var CurrentUpdateInfo = UpdateInfo.FromString(e.Result);
|
||||
Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True);
|
||||
Version v;
|
||||
Version.TryParse(GeneralAppInfo.ApplicationVersion, out v);
|
||||
var IsNewer = CurrentUpdateInfo.Version > v;
|
||||
Assert.That(IsNewer, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void UpdateDevChannel()
|
||||
{
|
||||
GeneralAppInfo.ApplicationVersion = "1.0.0.0";
|
||||
var _upd = new AppUpdater();
|
||||
var e = _upd.DownloadString(UpdateChannelInfo.GetUpdateChannelInfo(UpdateChannelInfo.DEV));
|
||||
Assert.That(e.Cancelled, Is.False);
|
||||
Assert.That(e.Error, Is.Null);
|
||||
var CurrentUpdateInfo = UpdateInfo.FromString(e.Result);
|
||||
Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True);
|
||||
Version v;
|
||||
Version.TryParse(GeneralAppInfo.ApplicationVersion, out v);
|
||||
var IsNewer = CurrentUpdateInfo.Version > v;
|
||||
Assert.That(IsNewer, Is.True);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user