Beispiel #1
0
        public static IJsonRpcService BuildRpcService <T>(T module) where T : class, IModule
        {
            var moduleProvider = new TestRpcModuleProvider <T>(module);

            moduleProvider.Register(new SingletonModulePool <T>(new SingletonFactory <T>(module), true));
            IJsonRpcService service = new JsonRpcService(moduleProvider, LimboLogs.Instance);

            return(service);
        }
Beispiel #2
0
        public static IJsonRpcService BuildRpcService <T>(T module, IReadOnlyCollection <JsonConverter>?converters = null) where T : class, IRpcModule
        {
            var moduleProvider = new TestRpcModuleProvider <T>(module);

            moduleProvider.Register(new SingletonModulePool <T>(new TestSingletonFactory <T>(module, converters), true));
            IJsonRpcService service = new JsonRpcService(moduleProvider, LimboLogs.Instance);

            return(service);
        }
Beispiel #3
0
        public static IJsonRpcService BuildRpcService <T>(T module) where T : class, IModule
        {
            var moduleProvider = new TestRpcModuleProvider <T>(module);

            moduleProvider.Register <T>(module);
            IJsonRpcService service = new JsonRpcService(moduleProvider, NullLogManager.Instance);

            return(service);
        }
Beispiel #4
0
        public static IJsonRpcService BuildRpcService <T>(T module) where T : class, IModule
        {
            var moduleProvider = new TestRpcModuleProvider <T>(module);

            moduleProvider.Register <T>(module);
            Newtonsoft.Json.JsonSerializer rpcSerializer = new Newtonsoft.Json.JsonSerializer();
            IJsonRpcService service = new JsonRpcService(moduleProvider, Substitute.For <IConfigProvider>(), NullLogManager.Instance);

            return(service);
        }