public void Import(IEnumerable<ScanHost> hosts, ContainerInfo destinationContainer) { var deserializer = new PortScanDeserializer(hosts, _targetProtocolType); var connectionTreeModel = deserializer.Deserialize(); var importedRootNode = connectionTreeModel.RootNodes.First(); if (importedRootNode == null) return; var childrenToAdd = importedRootNode.Children.ToArray(); destinationContainer.AddChildRange(childrenToAdd); }
public void OnetimeSetup() { var host = new ScanHost("10.20.30.40") { HostName = "server1.domain.com", SSH = true }; _deserializer = new PortScanDeserializer(new [] {host}, ProtocolType.SSH2); _deserializer.Deserialize(); var connectionTreeModel = _deserializer.Deserialize(); var root = connectionTreeModel.RootNodes.First(); _importedConnectionInfo = root.Children.First(); }
public void OnetimeTeardown() { _deserializer = null; _importedConnectionInfo = null; }