public void BindNoSourceLine() { var mockDocumentPosition = Substitute.For <IDebugDocumentPosition2>(); string value; mockDocumentPosition.GetFileName(out value).Returns(x => { x[0] = TEST_FILE_NAME; return(0); }); mockDocumentPosition.GetRange(Arg.Any <TEXT_POSITION[]>(), null).Returns( VSConstants.E_FAIL); mockMarshal.GetDocumentPositionFromIntPtr(Arg.Any <IntPtr>()).Returns( mockDocumentPosition); var result = pendingBreakpoint.Bind(); IDebugErrorBreakpoint2 breakpointError = GetBreakpointError(); Assert.That(GetBreakpointErrorMessage(breakpointError), Does.Contain("line number")); mockBreakpointManager.Received().ReportBreakpointError( Arg.Any <DebugBreakpointError>()); Assert.AreEqual(VSConstants.S_FALSE, result); }