Exemple #1
0
        private void CreateRemoteService()
        {
            this.pipeChannelFactory?.Dispose();
            this.pipeChannelFactory = new PipeChannelFactory();
            Mock <IServiceLocator> serviceLocator = new Mock <IServiceLocator>();

            serviceLocator.Setup(m => m.GetServiceUrl("TestService")).Returns("pipe://F77DE1FB-F58D-433A-B626-889FC77D096B/TestService");

            ServiceInterfaceFactory factory = new ServiceInterfaceFactory(serviceLocator.Object, this.pipeChannelFactory);

            this.remoteService = factory.CreateServiceInterface("TestService");
        }
Exemple #2
0
        public void PipeAuthorization_CheckPath_InvalidPathTest()
        {
            this.communicatorServer = new PipeCommunicatorServer("CA25C0E2-72DE-46DC-845B-01A92E633D2B");
            this.communicatorServer.Start();
            PipeAuthorizationChecker checker = new PipeAuthorizationChecker();

            this.communicatorServer.AuthorizationChecker = checker;
            checker.PathList.Clear();

            this.channelFactory = new PipeChannelFactory();
            IMessenger messenger = this.channelFactory.GetMessenger("pipe://CA25C0E2-72DE-46DC-845B-01A92E633D2B");

            messenger.Send("test");
        }
Exemple #3
0
        public void PipeAuthorization_CheckPathTest()
        {
            this.communicatorServer = new PipeCommunicatorServer("CA25C0E2-72DE-46DC-845B-01A92E633D2B");
            this.communicatorServer.Start();
            PipeAuthorizationChecker checker = new PipeAuthorizationChecker {
                EnableAuthenticodeCheck = false
            };

            this.communicatorServer.AuthorizationChecker = checker;

            this.channelFactory = new PipeChannelFactory();
            IMessenger messenger = this.channelFactory.GetMessenger("pipe://CA25C0E2-72DE-46DC-845B-01A92E633D2B");

            messenger.Send("test");
        }
 private static void SendUpdateLicenseMessageToService()
 {
     try
     {
         Log.Information("VpnGui: sending update license to service.");
         PipeChannelFactory pipeChannelFactory = new PipeChannelFactory();
         IService           arg_49_0           = new ServiceInterfaceFactory(new ServiceLocator(), pipeChannelFactory).CreateServiceInterface("VPN");
         bool responceReceived = false;
         arg_49_0.Request(Message.CreateRequest("license/update"), delegate(Message m)
         {
             responceReceived = true;
         }, null);
         Program.WaitUntil(() => responceReceived, 4000);
         pipeChannelFactory.Dispose();
     }
     catch (Exception arg)
     {
         Log.Warning(string.Format("Error on creating communication chanel with service:{0}", arg));
     }
 }