mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Began creating integration tests for the connection tree
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user