public void SetUp()
        {
            _lldbShell         = Substitute.For <ILLDBShell>();
            _breakpointManager = Substitute.For <IBreakpointManager>();
            _moduleFileLoader  = Substitute.For <IModuleFileLoader>();

            _debugger           = Substitute.For <SbDebugger>();
            _target             = Substitute.For <RemoteTarget>();
            _listenerSubscriber = Substitute.For <ILldbListenerSubscriber>();
            _process            = Substitute.For <SbProcess>();

            _debugEngineHandler = Substitute.For <IDebugEngineHandler>();
            _taskExecutor       = Substitute.For <ITaskExecutor>();
            _eventManager       = Substitute.For <IEventManager>();

            var exceptionManagerFactory =
                new LldbExceptionManager.Factory(new Dictionary <int, YetiCommon.Signal>());
            var exceptionManager = exceptionManagerFactory.Create(_process);

            _debugModuleCache = Substitute.For <IDebugModuleCache>();
            _debugProgram     = Substitute.For <IGgpDebugProgram>();

            _attachedProgram = new LldbAttachedProgram(
                _breakpointManager, _eventManager, _lldbShell, _moduleFileLoader,
                _debugEngineHandler, _taskExecutor, _debugProgram, _debugger, _target, _process,
                exceptionManager, _debugModuleCache, _listenerSubscriber, _remotePid);
        }
        DebugSessionLauncher.Factory CreateLauncherFactory(bool stadiaPlatformAvailable,
                                                           PlatformFactoryFakeConnectRecorder
                                                           connectRecorder = null)
        {
            _debuggerFactory =
                new GrpcDebuggerFactoryFake(new TimeSpan(0), stadiaPlatformAvailable);
            _platformFactory = new GrpcPlatformFactoryFake(connectRecorder);
            var taskContext = new JoinableTaskContext();

            _listenerFactory = new GrpcListenerFactoryFake();

            // If stadiaPlatformAvailable is True the DebugSessionLauncher will connect
            // to the platform 'remote-stadia', otherwise it will use 'remote-linux'
            var platformName = stadiaPlatformAvailable
                ? "remote-stadia"
                : "remote-linux";

            _platformFactory.AddFakeProcess(platformName, _gameBinary, 44);
            var exceptionManagerFactory =
                new LldbExceptionManager.Factory(new Dictionary <int, Signal>());
            var connectOptionsFactory       = new GrpcPlatformConnectOptionsFactory();
            var platformShellCommandFactory = new GrpcPlatformShellCommandFactory();

            var childAdapterFactory = new RemoteValueChildAdapter.Factory();
            var varInfoFactory      = new LLDBVariableInformationFactory(childAdapterFactory);

            var taskExecutor = new TaskExecutor(taskContext.Factory);

            var debugCodeContextFactory =
                new DebugCodeContext.Factory(new DebugMemoryContext.Factory());

            var debugDocumentContextFactory = new DebugDocumentContext.Factory();
            var threadsEnumFactory          = new ThreadEnumFactory();
            var moduleEnumFactory           = new ModuleEnumFactory();
            var frameEnumFactory            = new FrameEnumFactory();
            var codeContextEnumFactory      = new CodeContextEnumFactory();

            var lldbModuleUtil   = new LldbModuleUtil();
            var moduleFileFinder = Substitute.For <IModuleFileFinder>();
            var moduleFileLoadRecorderFactory =
                new ModuleFileLoadMetricsRecorder.Factory(lldbModuleUtil, moduleFileFinder);
            var mockBinaryFileUtil     = Substitute.For <IBinaryFileUtil>();
            var lldbShell              = Substitute.For <ILLDBShell>();
            var actionRecorder         = new ActionRecorder(Substitute.For <IMetrics>());
            var symbolSettingsProvider = Substitute.For <ISymbolSettingsProvider>();
            var attachedProgramFactory = new LldbAttachedProgram.Factory(
                taskContext, new DebugEngineHandler.Factory(taskContext), taskExecutor,
                new LldbEventManager.Factory(new BoundBreakpointEnumFactory(), taskContext),
                new DebugProgram.Factory(taskContext,
                                         new DebugDisassemblyStream.Factory(
                                             debugCodeContextFactory, debugDocumentContextFactory),
                                         debugDocumentContextFactory, debugCodeContextFactory,
                                         threadsEnumFactory, moduleEnumFactory,
                                         codeContextEnumFactory),
                new DebugModuleCache.Factory(new SynchronousDispatcher()),
                new DebugModule.Factory(
                    FakeCancelableTask.CreateFactory(new JoinableTaskContext(), false),
                    actionRecorder, moduleFileLoadRecorderFactory, lldbModuleUtil,
                    symbolSettingsProvider),
                new DebugThread.Factory(frameEnumFactory, taskExecutor).Create,
                new DebugStackFrame.Factory(debugDocumentContextFactory,
                                            new ChildrenProvider.Factory(), debugCodeContextFactory,
                                            Substitute.For <DebugExpression.Factory>().Create,
                                            varInfoFactory,
                                            new VariableInformationEnum.Factory(taskExecutor),
                                            new RegisterSetsBuilder.Factory(varInfoFactory),
                                            taskExecutor).Create, lldbShell,
                new LldbBreakpointManager.Factory(taskContext,
                                                  new DebugPendingBreakpoint.Factory(
                                                      taskContext,
                                                      new DebugBoundBreakpoint.Factory(
                                                          debugDocumentContextFactory,
                                                          debugCodeContextFactory,
                                                          new DebugBreakpointResolution.Factory()),
                                                      new BreakpointErrorEnumFactory(),
                                                      new BoundBreakpointEnumFactory()),
                                                  new DebugWatchpoint.Factory(
                                                      taskContext,
                                                      new DebugWatchpointResolution.Factory(),
                                                      new BreakpointErrorEnumFactory(),
                                                      new BoundBreakpointEnumFactory())),
                new SymbolLoader.Factory(lldbModuleUtil, mockBinaryFileUtil, moduleFileFinder),
                new BinaryLoader.Factory(lldbModuleUtil, moduleFileFinder),
                Substitute.For <IModuleFileLoaderFactory>());

            var coreAttachWarningDialog = new CoreAttachWarningDialogUtil(
                taskContext, Substitute.For <IDialogUtil>());

            return(new DebugSessionLauncher.Factory(
                       taskContext, _debuggerFactory, _listenerFactory, _platformFactory,
                       connectOptionsFactory, platformShellCommandFactory, attachedProgramFactory,
                       actionRecorder, moduleFileLoadRecorderFactory, exceptionManagerFactory, _fileSystem,
                       false, moduleFileFinder, new DumpModulesProvider(_fileSystem),
                       new ModuleSearchLogHolder(), symbolSettingsProvider, coreAttachWarningDialog));
        }