Began creating integration tests for the connection tree

This commit is contained in:
David Sparer
2016-08-15 14:47:26 -06:00
parent 818ac03e84
commit d0be7f16ba
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using mRemoteNG.Connection;
using mRemoteNG.Container;
using mRemoteNG.Tree.Root;
using NUnit.Framework;
namespace mRemoteNGTests.IntegrationTests
{
public class ConnectionInheritanceIntegrationTests
{
private RootNodeInfo _rootNode;
[SetUp]
public void Setup()
{
_rootNode = new RootNodeInfo(RootNodeType.Connection);
}
[TearDown]
public void Teardown()
{
}
[Test]
public void ConnectionsInheritFromCorrectFolder()
{
/**
* Root
* --Folder1
* ----Connection1
* ----Folder2
* ------Connection2
* ----Connection3 (inherits username)
*/
var folder1 = new ContainerInfo {Username = "folder1User"};
var folder2 = new ContainerInfo {Username = "folder2User"};
var connection1 = new ConnectionInfo();
var connection2 = new ConnectionInfo();
var connection3 = new ConnectionInfo {Inheritance = {Username = true}};
_rootNode.Add(folder1);
folder1.AddRange(new []{connection1, folder2, connection3});
folder2.Add(connection2);
Assert.That(connection3.Username, Is.EqualTo(folder1.Username));
}
}
}

View File

@@ -106,6 +106,7 @@
<Compile Include="Connection\DefaultConnectionInfoTests.cs" />
<Compile Include="Connection\DefaultConnectionInheritanceTests.cs" />
<Compile Include="Container\ContainerInfoTests.cs" />
<Compile Include="IntegrationTests\ConnectionInheritanceIntegrationTests.cs" />
<Compile Include="ListViewTester.cs" />
<Compile Include="Config\Connections\SqlConnectionUpdateCheckerTests.cs" />
<Compile Include="Config\Connections\SqlUpdateQueryBuilderTest.cs" />