public void Init()
		{
			helper = new ClassHelper();
			document = MockRepository.GenerateStub<IRefactoringDocument>();
			documentView = MockRepository.GenerateStub<IRefactoringDocumentView>();
			documentLoader = MockRepository.GenerateStub<IDocumentLoader>();
			fakeCodeGenerator = helper.CompilationUnitHelper.FakeCodeGenerator;
		}
示例#2
0
		void CreateProjectContent()
		{
			helper = new ClassHelper();
		}
		ClassHelper CreateClassHelper(string name)
		{
			var helper = new ClassHelper();
			helper.CreateClass(name);
			return helper;
		}
示例#4
0
		public void Init()
		{
			helper = new ReturnTypeHelper();
			classHelper = new ClassHelper();
			parent = new CodeElement();
		}
示例#5
0
		void ReturnTypeUsesDifferentProjectContent()
		{
			classHelper = new ClassHelper();
			classHelper.ProjectContentHelper.SetProjectForProjectContent(ProjectHelper.CreateTestProject());
		}
		public void Init()
		{
			classHelper = new ClassHelper();
			document = MockRepository.GenerateStub<IRefactoringDocument>();
			documentLoader = MockRepository.GenerateStub<IDocumentLoader>();
		}
		public void Type_PropertyTypeExistsInProject_TypeRefTypeInfoLocationIsProject()
		{
			helper.CreatePublicProperty("MyProperty");
			helper.SetPropertyReturnType("MyType");
			helper.CreateProjectForProjectContent();
			var classHelper = new ClassHelper();
			classHelper.CreateClass("MyType");
			classHelper.SetProjectForProjectContent(helper.Project);
			helper.ReturnTypeHelper.AddUnderlyingClass(classHelper.Class);
			CreateCodeProperty2();
			
			CodeTypeRef typeRef = property.Type;
			vsCMInfoLocation location = typeRef.CodeType.InfoLocation;
			
			Assert.AreEqual(vsCMInfoLocation.vsCMInfoLocationProject, location);
		}
		public void Type_PropertyTypeIsSystemString_TypeRefTypeInfoLocationIsExternal()
		{
			helper.CreatePublicProperty("MyProperty");
			helper.SetPropertyReturnType("System.String");
			helper.CreateProjectForProjectContent();
			var classHelper = new ClassHelper();
			classHelper.CreateClass("System.String");
			classHelper.SetProjectForProjectContent(null);
			helper.ReturnTypeHelper.AddUnderlyingClass(classHelper.Class);
			CreateCodeProperty2();
			
			CodeTypeRef typeRef = property.Type;
			vsCMInfoLocation location = typeRef.CodeType.InfoLocation;
			
			Assert.AreEqual(vsCMInfoLocation.vsCMInfoLocationExternal, location);
		}
示例#9
0
		ClassHelper CreateClassHelperWithPublicClass(string name)
		{
			var classHelper = new ClassHelper();
			classHelper.CreatePublicClass(name);
			return classHelper;
		}
		public void Init()
		{
			helper = new ClassHelper();
		}