I am writing some unit test method to check some functionality after user selects a particular characters within the .cs file/.
So for this, I have created dte object & set its Active Document to my abc.cs file & want to programmatically select a few characters within a line in that abc.cs file.
((TextSelection)m_testHelper.Dte2.ActiveDocument.Selection).GotoLine(46,true);
This allows to select the whole line(no. 46 in abc .cs file). But I want the text in quotes to be set for Selection as below shown in abc .cs file at Line no. 46
private const string HeartBeatFileName = "abc.exe.heartbeat";
Also tried:
((TextSelection)m_testHelper.Dte2.ActiveDocument.Selection).MoveToLineAndOffset(46, 50, true);
But nt working as expected. Am I doing something wrong??