public void SetUpFixture() { mockClass = new MockClass("Tests.MyTestFixture"); mockMethod = new MockMethod(mockClass, "MyMethod"); mockMethodRegion = new DomRegion(0, 0, 0, 10); mockMethod.Region = mockMethodRegion; mockMethodBodyRegion = new DomRegion(1, 0, 2, 5); mockMethod.BodyRegion = mockMethodBodyRegion; mockMethod.Modifiers = ModifierEnum.Public; MockClass returnTypeClass = new MockClass("Tests.ReturnType"); returnType = new DefaultReturnType(returnTypeClass); mockMethod.ReturnType = returnType; baseTestMethod = new BaseTestMember(mockClass, mockMethod); }
public void Init() { baseClassMethod = MockMethod.CreateMockMethodWithoutAnyAttributes(); baseClassMethod.DeclaringType.CompilationUnit.FileName = @"c:\projects\mytest.cs"; MockClass derivedClass = MockClass.CreateMockClassWithoutAnyAttributes(); derivedClass.CompilationUnit.FileName = @"d:\projects\myderivedtestclass.cs"; int methodBeginLine = 3; // 1 based. int methodBeginColumn = 6; // 1 based. baseClassMethod.Region = new DomRegion(methodBeginLine, methodBeginColumn); BaseTestMember baseTestMethod = new BaseTestMember(derivedClass, baseClassMethod); treeView = new MockTestTreeView(); treeView.SelectedMember = baseTestMethod; fileService = new MockFileService(); gotoDefinitionCommand = new GotoDefinitionCommand(fileService); gotoDefinitionCommand.Owner = treeView; gotoDefinitionCommand.Run(); }
public void TestClassHasBaseClassTestMethod() { BaseTestMember baseTestMethod = testClass.TestMembers[1].Member as BaseTestMember; Assert.AreEqual(baseClassTestMethod, baseTestMethod.Member); }