public void Resolve_FieldHasNoReturnType_DoesNotThrowNullReferenceException()
		{
			MockProjectContent projectContent = new MockProjectContent();
			UnitTestingUtils.MockClass c = new UnitTestingUtils.MockClass(projectContent, "Test");
			projectContent.SetClassToReturnFromGetClass("self", c);
			DefaultField field = c.AddField("randomNumber");
			field.ReturnType = null;
			ParseInformation parseInfo = new ParseInformation(c.CompilationUnit);
			
			ExpressionResult expression = new ExpressionResult("self.randomNumber.randint", ExpressionContext.Default);
			PythonClassResolver classResolver = new PythonClassResolver();
			PythonLocalVariableResolver localVariableResolver = new PythonLocalVariableResolver(classResolver);
			PythonMemberResolver resolver = new PythonMemberResolver(classResolver, localVariableResolver);
			
			PythonResolverContext context = new PythonResolverContext(parseInfo, expression, "class Test:\r\npass");
			Assert.DoesNotThrow(delegate { resolver.Resolve(context); });
		}
Exemplo n.º 2
0
        public PythonResolver()
        {
            methodResolver            = new PythonStandardModuleMethodResolver(standardModuleResolver);
            localVariableResolver     = new PythonLocalVariableResolver(classResolver);
            memberResolver            = new PythonMemberResolver(classResolver, localVariableResolver);
            methodReturnValueResolver = new PythonMethodReturnValueResolver(memberResolver);

            resolvers.Add(importResolver);
            resolvers.Add(classResolver);
            resolvers.Add(standardModuleResolver);
            resolvers.Add(methodReturnValueResolver);
            resolvers.Add(memberResolver);
            resolvers.Add(methodResolver);
            resolvers.Add(selfResolver);
            resolvers.Add(namespaceResolver);
            resolvers.Add(localVariableResolver);
        }
Exemplo n.º 3
0
		public PythonResolver()
		{
			methodResolver = new PythonStandardModuleMethodResolver(standardModuleResolver);
			localVariableResolver = new PythonLocalVariableResolver(classResolver);
			memberResolver = new PythonMemberResolver(classResolver, localVariableResolver);
			methodReturnValueResolver = new PythonMethodReturnValueResolver(memberResolver);
			
			resolvers.Add(importResolver);
			resolvers.Add(classResolver);
			resolvers.Add(standardModuleResolver);
			resolvers.Add(methodReturnValueResolver);
			resolvers.Add(memberResolver);
			resolvers.Add(methodResolver);
			resolvers.Add(selfResolver);
			resolvers.Add(namespaceResolver);
			resolvers.Add(localVariableResolver);
		}
Exemplo n.º 4
0
		public PythonMemberResolver(PythonClassResolver classResolver, PythonLocalVariableResolver localVariableResolver)
		{
			this.classResolver = classResolver;
			this.localVariableResolver = localVariableResolver;
		}
 public PythonMemberResolver(PythonClassResolver classResolver, PythonLocalVariableResolver localVariableResolver)
 {
     this.classResolver         = classResolver;
     this.localVariableResolver = localVariableResolver;
 }