Beispiel #1
0
        public void GetName()
        {
            var THREAD_NAME = "thread-name";
            var lldbThread  = Substitute.For <RemoteThread>();

            lldbThread.GetName().Returns(THREAD_NAME);
            IDebugThread thread = CreateDebugThread <IDebugThread>(lldbThread);
            string       debugThreadName;

            thread.GetName(out debugThreadName);
            Assert.AreEqual(THREAD_NAME, debugThreadName);
        }
        public void SetUp()
        {
            var taskContext = new JoinableTaskContext();

            logSpy = new LogSpy();
            logSpy.Attach();

            program     = Substitute.For <IGgpDebugProgram>();
            debugEngine = Substitute.For <IDebugEngine2>();
            callback    = Substitute.For <IDebugEventCallback2>();

            handler = new DebugEngineHandler(taskContext, debugEngine, callback);

            var idArg = Arg.Any <Guid>();

            program.GetProgramId(out idArg)
            .Returns(x =>
            {
                x[0] = programId;
                return(VSConstants.S_OK);
            });

            var nameArg = Arg.Any <string>();

            program.GetName(out nameArg)
            .Returns(x =>
            {
                x[0] = programName;
                return(VSConstants.S_OK);
            });

            thread = Substitute.For <IDebugThread>();

            var threadNameArg = Arg.Any <string>();

            thread.GetName(out threadNameArg)
            .Returns(x =>
            {
                x[0] = threadName;
                return(VSConstants.S_OK);
            });

            var threadIdArg = Arg.Any <uint>();

            thread.GetThreadId(out threadIdArg)
            .Returns(x =>
            {
                x[0] = threadId;
                return(VSConstants.S_OK);
            });
        }