private static List<FavoriteConfigurationElement> TryImport(string fileName)
        {
            var document = new Document(fileName);
            if (!document.IsVersion22)
                throw new NotSupportedException("Rdc manager supports only version 2.2 import");

            var context = new ImportContext(document.Groups, document.Servers);
            context.ImportContent();
            return context.Imported;
        }
 public void ReadServersOnlyDocument_ResolvesServerName2()
 {
     string fileName = this.GetFullFileName(SERVERSONLY_FILE_NAME);
     var document = new Document(fileName);
     Server server2 = document.Servers.ToList()[1];
     const string MESSAGE = "Second server in document root level should contain ServerName2 display name";
     Assert.AreEqual(SERVER_NAME2, server2.DisplayName, MESSAGE);
 }
 public void ReadInheritedDocument_ResolvesInheritedConnectionSettings()
 {
     string fileName = this.GetFullFileName(INHERITED_FILE_NAME);
     var document = new Document(fileName);
     var group = document.Groups.First();
     Server server2 = group.Servers.First();
     const string MESSAGE = "Server should contain not inherited port value";
     Assert.AreEqual(9999, server2.ConnectionSettings.Port, MESSAGE);
 }