protected override ExpressionResult GetExpressionResult()
		{
			systemConsoleClass = new MockClass(projectContent, "System.Console");
			systemConsoleClass.AddMethod("WriteLine");
			projectContent.SetClassToReturnFromGetClass("Console", systemConsoleClass);
			return new ExpressionResult("Console.WriteLine", new DomRegion(2, 2), null, null);
		}
		void CreateClassWithOneProperty()
		{
			resolverHelper = new PythonResolverTestsHelper();
			myClass = resolverHelper.CreateClass("MyClass");
			myClass.AddMethod("MyMethod");
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
		}
		void CreateResolver()
		{
			resolverHelper = new PythonResolverTestsHelper();
			myClass = resolverHelper.CreateClass("MyClass");
			myMethod = myClass.AddMethod("MyMethod");
			myMethod.ReturnType = new DefaultReturnType(myClass);
			
			resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
		}
Esempio n. 4
0
		public void AddMethod_PassedMethodName_ReturnsMethodWithExpectedName()
		{
			MockClass c = new MockClass();
			IMethod myMethod = c.AddMethod("MyMethod");			
			string name = myMethod.Name;
			
			Assert.AreEqual("MyMethod", name);
		}
Esempio n. 5
0
		public void AddMethod_PassedName_AddsMethodToClass()
		{
			MockClass c = new MockClass();
			c.AddMethod("MyMethod");
			
			IMethod myMethod = c.Methods[0];
			string name = myMethod.Name;
			
			Assert.AreEqual("MyMethod", name);
		}