public void Test_IfDetectorReturnsFalseIfWcfServiceSectionDoesNotExists() { File.WriteAllText(testFilePath, serviceNotExistsConfigText); var detector = new ServiceDetector(testFilePath); Assert.False(detector.Find()); }
public void Test_IfDetectorReturnsTrueIfWcfServiceExists() { File.WriteAllText(testFilePath, serviceExistsConfigText); var detector = new ServiceDetector(testFilePath); Assert.True(detector.Find()); }
private static string Resolve(int port, params IConnectionPlugin[] plugins) { Mock <IConnectionManager> mockConnectionManager = CreateConnecitonManager(plugins); var detector = new ServiceDetector(mockConnectionManager.Object); return(detector.ResolveServiceName(IRRELEVANT_IP_ADDRESS, port)); }
private int ExecuteCommand(IIgnite ignite, List <string> sources, List <string> methods) { var compute = ignite.GetCompute(); foreach (var cacheName in sources) { var flowCache = ignite.GetOrCreateCache <object, object>(cacheName); logger.Info($"Detecting services in flow cache: {cacheName}..."); var serviceDetector = new ServiceDetector(flowCache.Name); compute.Broadcast(serviceDetector); logger.Info($"Detecting services in flow cache: {cacheName} completed."); } return(0); }
private void AttemptConnect(IAsyncResult result) { var connectionState = result.AsyncState as ConnectionState; var socket = connectionState.Client.Client; if (socket != null && socket.Connected) { var detector = new ServiceDetector(this.connectionManager); var serviceName = detector.ResolveServiceName(this.iPAddress, connectionState.Port); this.FireOnScanHit(connectionState.Port, serviceName); } else { Debug.WriteLine("Port {0} not openend at {1}", this.iPAddress, connectionState.Port); } connectionState.Done = true; }