Merge branch 'master' into develop

# Conflicts:
#	CHANGELOG.TXT
#	mRemoteV1/App/Startup.cs
#	mRemoteV1/Properties/AssemblyInfo.cs
This commit is contained in:
David Sparer
2017-12-05 08:00:23 -06:00
3 changed files with 53 additions and 5 deletions

View File

@@ -41,6 +41,15 @@ General Changes:
Improved compatability between environments when building mRemoteNG from source
1.75.7012 (2017-12-01):
Fixes:
------
#814: Fixed bug that prevented reordering connections by dragging
#810: Official mRemoteNG builds will now be signed with a DigiCert certificate
#803: File path command line argument not working with network path
1.75.7011 (2017-11-07):
Fixes:

View File

@@ -1,13 +1,16 @@
using mRemoteNG.Connection;
using System.Collections.Generic;
using System.Reflection;
using mRemoteNG.Connection;
using mRemoteNG.Connection.Protocol;
using mRemoteNG.Connection.Protocol.SSH;
using mRemoteNG.Container;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
namespace mRemoteNGTests.Connection
{
public class ConnectionInfoTests
public class ConnectionInfoTests
{
private ConnectionInfo _connectionInfo;
private const string TestDomain = "somedomain";
@@ -91,7 +94,29 @@ namespace mRemoteNGTests.Connection
Assert.That(nameOfModifiedProperty, Is.EqualTo("OpenConnections"));
}
[TestCase(ProtocolType.HTTP, ExpectedResult = 80)]
[TestCaseSource(typeof(InheritancePropertyProvider), nameof(InheritancePropertyProvider.GetProperties))]
public void MovingAConnectionUnderRootNodeDisablesInheritance(PropertyInfo property)
{
var rootNode = new RootNodeInfo(RootNodeType.Connection);
_connectionInfo.Inheritance.EverythingInherited = true;
_connectionInfo.SetParent(rootNode);
var propertyValue = property.GetValue(_connectionInfo.Inheritance);
Assert.That(propertyValue, Is.False);
}
[TestCaseSource(typeof(InheritancePropertyProvider), nameof(InheritancePropertyProvider.GetProperties))]
public void MovingAConnectionFromUnderRootNodeToUnderADifferentNodeEnablesInheritance(PropertyInfo property)
{
var rootNode = new RootNodeInfo(RootNodeType.Connection);
var otherContainer = new ContainerInfo();
_connectionInfo.Inheritance.EverythingInherited = true;
_connectionInfo.SetParent(rootNode);
_connectionInfo.SetParent(otherContainer);
var propertyValue = property.GetValue(_connectionInfo.Inheritance);
Assert.That(propertyValue, Is.True);
}
[TestCase(ProtocolType.HTTP, ExpectedResult = 80)]
[TestCase(ProtocolType.HTTPS, ExpectedResult = 443)]
[TestCase(ProtocolType.ICA, ExpectedResult = 1494)]
[TestCase(ProtocolType.IntApp, ExpectedResult = 0)]
@@ -107,5 +132,13 @@ namespace mRemoteNGTests.Connection
_connectionInfo.Protocol = protocolType;
return _connectionInfo.GetDefaultPort();
}
private class InheritancePropertyProvider
{
public static IEnumerable<PropertyInfo> GetProperties()
{
return new ConnectionInfoInheritance(new object()).GetProperties();
}
}
}
}

View File

@@ -16,6 +16,7 @@ using mRemoteNG.Connection.Protocol.VNC;
using mRemoteNG.Container;
using mRemoteNG.Tools;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
namespace mRemoteNG.Connection
@@ -127,14 +128,19 @@ namespace mRemoteNG.Connection
return filteredProperties;
}
public virtual void SetParent(ContainerInfo parent)
public virtual void SetParent(ContainerInfo newParent)
{
RemoveParent();
parent?.AddChild(this);
newParent?.AddChild(this);
if (newParent is RootNodeInfo)
Inheritance.DisableInheritance();
}
public void RemoveParent()
{
if (Parent is RootNodeInfo)
Inheritance.EnableInheritance();
Parent?.RemoveChild(this);
}