Run tests from local resources

This commit is contained in:
Sean Kaim
2017-01-06 11:16:02 -05:00
parent 244d27427d
commit fd5e3e24df
11 changed files with 173 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
using System;
using mRemoteNG.App.Info;
using mRemoteNG.App.Update;
using mRemoteNGTests.Properties;
using NUnit.Framework;
namespace mRemoteNGTests.App
@@ -8,15 +9,12 @@ namespace mRemoteNGTests.App
[TestFixture]
public class UpdaterTests
{
#if !PORTABLE
[Test]
public void UpdateStableChannel()
{
GeneralAppInfo.ApplicationVersion = "1.0.0.0";
var _upd = new AppUpdater();
var e = _upd.DownloadString(UpdateChannelInfo.GetUpdateChannelInfo(UpdateChannelInfo.STABLE));
Assert.That(e.Cancelled, Is.False);
Assert.That(e.Error, Is.Null);
var CurrentUpdateInfo = UpdateInfo.FromString(e.Result);
var CurrentUpdateInfo = UpdateInfo.FromString(Resources.update);
Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True);
Version v;
Version.TryParse(GeneralAppInfo.ApplicationVersion, out v);
@@ -28,11 +26,7 @@ namespace mRemoteNGTests.App
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);
var CurrentUpdateInfo = UpdateInfo.FromString(Resources.beta_update);
Assert.That(CurrentUpdateInfo.CheckIfValid(), Is.True);
Version v;
Version.TryParse(GeneralAppInfo.ApplicationVersion, out v);
@@ -44,16 +38,50 @@ namespace mRemoteNGTests.App
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);
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;
Assert.That(IsNewer, Is.True);
}
#else
[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;
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;
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;
Assert.That(IsNewer, Is.True);
}
#endif
}
}

View File

@@ -60,6 +60,32 @@ namespace mRemoteNGTests.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.75.6164.27544
///dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Installer-1.75.6179.28160.msi
///clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
///CertificateThumbprint: 0CEA828E5C787EA8AA89268D83816C1EA03375BA
///Checksum: A1E50ACAC4CB8023527E1E7A0E682459
///.
/// </summary>
internal static string beta_update {
get {
return ResourceManager.GetString("beta_update", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.75.6170.27478
///dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Portable-1.75.6179.28241.zip
///clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
///Checksum: 1C35EA199F58001BC4EBB164D8B3D11C.
/// </summary>
internal static string beta_update_portable {
get {
return ResourceManager.GetString("beta_update_portable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
///&lt;Connections Name=&quot;Connections&quot; Export=&quot;False&quot; Protected=&quot;95syzRuZ4mRxpNkZQzoyX8SDpQXLyMq3GncO8o4SyTBoYvn3TAWgn05ZEU2DrjkM&quot; ConfVersion=&quot;2.5&quot;&gt;
@@ -142,6 +168,32 @@ namespace mRemoteNGTests.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.75.6164.27544
///dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Installer-1.75.6179.28160.msi
///clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
///CertificateThumbprint: 0CEA828E5C787EA8AA89268D83816C1EA03375BA
///Checksum: A1E50ACAC4CB8023527E1E7A0E682459
///.
/// </summary>
internal static string dev_update {
get {
return ResourceManager.GetString("dev_update", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.75.6170.27478
///dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Portable-1.75.6179.28241.zip
///clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
///Checksum: 1C35EA199F58001BC4EBB164D8B3D11C.
/// </summary>
internal static string dev_update_portable {
get {
return ResourceManager.GetString("dev_update_portable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
///&lt;!-- ****************************************************************--&gt;
@@ -276,5 +328,30 @@ namespace mRemoteNGTests.Properties {
return ResourceManager.GetString("test_remotedesktopconnection_rdp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.72.5065.32737
///dURL: http://downloads.mremoteng.org/mRemoteNG-Installer-1.72.exe
///clURL: http://update.mremoteng.org/changes-1.72.txt
///CertificateThumbprint: 1cbd910dbd6e77f26506e7f600736972f700673f
///.
/// </summary>
internal static string update {
get {
return ResourceManager.GetString("update", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version: 1.75.6170.27478
///dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Portable-1.75.6179.28241.zip
///clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
///Checksum: 1C35EA199F58001BC4EBB164D8B3D11C.
/// </summary>
internal static string update_portable {
get {
return ResourceManager.GetString("update_portable", resourceCulture);
}
}
}
}

View File

@@ -118,6 +118,12 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="beta_update" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\beta-update.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="beta_update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\beta-update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="confCons_v2_5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\confCons_v2_5.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
@@ -142,6 +148,12 @@
<data name="confCons_v2_6_passwordis_Password_fullencryption" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\confCons_v2_6_passwordis_Password_fullencryption.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="dev_update" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dev-update.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="dev_update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dev-update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="test_puttyConnectionManager_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\test_puttyConnectionManager_database.dat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
@@ -163,4 +175,10 @@
<data name="test_remotedesktopconnection_rdp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\test_remotedesktopconnection.rdp;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
<data name="update" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\update.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="update_portable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\update-portable.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

View File

@@ -0,0 +1,4 @@
Version: 1.75.6170.27478
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Portable-1.75.6179.28241.zip
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
Checksum: 1C35EA199F58001BC4EBB164D8B3D11C

View File

@@ -0,0 +1,5 @@
Version: 1.75.6164.27544
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Installer-1.75.6179.28160.msi
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
CertificateThumbprint: 0CEA828E5C787EA8AA89268D83816C1EA03375BA
Checksum: A1E50ACAC4CB8023527E1E7A0E682459

View File

@@ -0,0 +1,4 @@
Version: 1.75.6170.27478
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Portable-1.75.6179.28241.zip
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
Checksum: 1C35EA199F58001BC4EBB164D8B3D11C

View File

@@ -0,0 +1,5 @@
Version: 1.75.6164.27544
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Installer-1.75.6179.28160.msi
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
CertificateThumbprint: 0CEA828E5C787EA8AA89268D83816C1EA03375BA
Checksum: A1E50ACAC4CB8023527E1E7A0E682459

View File

@@ -0,0 +1,4 @@
Version: 1.75.6170.27478
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Portable-1.75.6179.28241.zip
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
Checksum: 1C35EA199F58001BC4EBB164D8B3D11C

View File

@@ -0,0 +1,5 @@
Version: 1.75.6164.27544
dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/v1.75Beta3/mRemoteNG-Installer-1.75.6179.28160.msi
clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/v1.75Beta3/CHANGELOG.TXT
CertificateThumbprint: 0CEA828E5C787EA8AA89268D83816C1EA03375BA
Checksum: A1E50ACAC4CB8023527E1E7A0E682459

View File

@@ -208,6 +208,14 @@
<ItemGroup>
<None Include="Resources\confCons_v2_5_passwordis_Password_fullencryption.xml" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\beta-update-portable.txt" />
<Content Include="Resources\beta-update.txt" />
<Content Include="Resources\dev-update-portable.txt" />
<Content Include="Resources\dev-update.txt" />
<Content Include="Resources\update-portable.txt" />
<Content Include="Resources\update.txt" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>

View File

@@ -24,12 +24,6 @@ namespace mRemoteNG.App.Info
return GetUpdateTxtUri(channel);
}
public static Uri GetUpdateChannelInfo(string s)
{
var channel = IsValidChannel(s) ? s : STABLE;
return GetUpdateTxtUri(channel);
}
private static string GetChannelFileName(string channel)
{
#if PORTABLE