示例#1
0
        public void InstantiateServiceTest()
        {
            var context = new ClientCompositionRoot(new TestsCompositionRoot(null));

            context.RegisterInstance <INetworkClientConnection>(new NetworkConnectionStub());
            context.Resolve <SimulationService>().Initialize();
            context.Release();
        }
示例#2
0
        private IContext BuildClient(IContext context, ConnectionData config)
        {
            var root          = context.Resolve <IRootContext>();
            var moduleContext = new ClientCompositionRoot(root);
            var connection    = new SimulatorConnection(context)
            {
                ConnectionData = config
            };

            _connections = (_connections ?? new SimulatorConnection[] { }).Concat(new[] { connection }).ToArray();
            moduleContext.RegisterInstance <INetworkClientConnection>(connection);
            return(moduleContext);
        }