public void InstantiateServiceTest() { var context = new ClientCompositionRoot(new TestsCompositionRoot(null)); context.RegisterInstance <INetworkClientConnection>(new NetworkConnectionStub()); context.Resolve <SimulationService>().Initialize(); context.Release(); }
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); }