public void SendEventDebugThreadWithNoThreadId() { var idArg = Arg.Any <uint>(); thread.GetThreadId(out idArg) .Returns(x => { x[0] = threadId; return(VSConstants.S_FALSE); }); var evnt = new TestEvent(5); handler.SendEvent(evnt, program, thread); var id = Arg.Any <Guid>(); callback.Received(1).Event(debugEngine, null, program, thread, evnt, ref id, 5); var output = logSpy.GetOutput(); Assert.That(output, Does.Contain(programName)); Assert.That(output, Does.Contain(programId.ToString())); Assert.That(output, Does.Contain(threadName)); Assert.That(output, Does.Not.Contain(threadId.ToString())); }
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); }); }