Esempio n. 1
0
        public void ReplaceText_EditPointCreatedFromMethodStartPoint_ReplacesTextBetweenStartAndEndPoint()
        {
            string fileName         = @"d:\projects\test.cs";
            var    methodRegion     = new DomRegion(1, 5, 1, 10);
            var    methodBodyRegion = new DomRegion(1, 10, 3, 12);

            CreateMethod(fileName, methodRegion, methodBodyRegion);
            methodHelper.AddDeclaringType("MyClass");
            DocumentOffsetToReturn(line: 1, column: 5, offset: 5);
            DocumentOffsetToReturn(line: 3, column: 12, offset: 20);
            DocumentFileName(fileName);
            CreateMethodEditPoint();

            ReplaceText("Test");

            document.AssertWasCalled(d => d.Replace(5, 15, "Test"));
        }
Esempio n. 2
0
 void SetDeclaringType(string name)
 {
     helper.AddDeclaringType(name);
 }