void CreateClassWithOneEvent()
		{
			resolverHelper = new PythonResolverTestsHelper();
			myClass = resolverHelper.CreateClass("MyClass");
			myClassField = myClass.AddField("MyField");
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
		}
		void CreateClassWithOneProperty()
		{
			resolverHelper = new PythonResolverTestsHelper();
			myClass = resolverHelper.CreateClass("MyClass");
			myClass.AddMethod("MyMethod");
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
		}
		void CreateResolver(string code)
		{
			resolverHelper = new PythonResolverTestsHelper(code);
			
			testClass = resolverHelper.CreateClass("Test.Test1");
			resolverHelper.ProjectContent.ClassesInProjectContent.Add(testClass);			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("Test.Test1", testClass);
		}
		void CreateResolver()
		{
			resolverHelper = new PythonResolverTestsHelper();
			myClass = resolverHelper.CreateClass("MyClass");
			myMethod = myClass.AddMethod("MyMethod");
			myMethod.ReturnType = new DefaultReturnType(myClass);
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
		}
		void CreateClassWithOneProperty()
		{
			resolverHelper = new PythonResolverTestsHelper();
			myClass = resolverHelper.CreateClass("MyClass");
			myClassProperty = myClass.AddProperty("MyProperty");
			
			AddNestedPropertyToExistingProperty();
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
		}
		void CreateClassWithOneEvent()
		{
			// Define imports.
			string code = 
				"from MyNamespace import MyClass";
			
			resolverHelper = new PythonResolverTestsHelper(code);
			myClass = resolverHelper.CreateClass("MyClass");
			myClassEvent = myClass.AddEvent("MyEvent");
			
			AddEventHandlerClass();
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyNamespace.MyClass", myClass);
		}
Esempio n. 7
0
		void CreateResolver(string code)
		{
			resolverHelper = new PythonResolverTestsHelper(code);
			fooClass = resolverHelper.CompilationUnit.Classes[0];
		}
Esempio n. 8
0
		public void Resolve_PropertyReferencedThroughSelfButOutsideClass_ReturnsNull()
		{
			string code = String.Empty;
			resolverHelper = new PythonResolverTestsHelper(code);
			resolverHelper.Resolve("self.name");
			
			ResolveResult result = resolverHelper.ResolveResult;
			
			Assert.IsNull(result);
		}