ensure putty root node returns correct tree node type. Related to #998

This commit is contained in:
David Sparer
2018-06-20 16:20:51 -05:00
parent 8497a05fd1
commit b7cdf81665
2 changed files with 13 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using mRemoteNG.Tree.Root;
using mRemoteNG.Tree;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
@@ -46,5 +47,13 @@ namespace mRemoteNGTests.Tree
_rootNodeInfo.PasswordString = password;
Assert.That(_rootNodeInfo.PasswordString, Is.EqualTo(password));
}
[TestCase(RootNodeType.Connection, TreeNodeType.Root)]
[TestCase(RootNodeType.PuttySessions, TreeNodeType.PuttyRoot)]
public void RootNodeHasCorrectTreeNodeType(RootNodeType rootNodeType, TreeNodeType expectedTreeNodeType)
{
var rootNode = new RootNodeInfo(rootNodeType);
Assert.That(rootNode.GetTreeNodeType(), Is.EqualTo(expectedTreeNodeType));
}
}
}

View File

@@ -66,7 +66,9 @@ namespace mRemoteNG.Tree.Root
public override TreeNodeType GetTreeNodeType()
{
return TreeNodeType.Root;
return Type == RootNodeType.Connection
? TreeNodeType.Root
: TreeNodeType.PuttyRoot;
}
#endregion