本文整理匯總了C#中UnitTesting.Tests.Utils.MockClass.AddMethod方法的典型用法代碼示例。如果您正苦於以下問題:C# MockClass.AddMethod方法的具體用法?C# MockClass.AddMethod怎麽用?C# MockClass.AddMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnitTesting.Tests.Utils.MockClass
的用法示例。
在下文中一共展示了MockClass.AddMethod方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetExpressionResult
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);
}
示例2: CreateClassWithOneProperty
void CreateClassWithOneProperty()
{
resolverHelper = new PythonResolverTestsHelper();
myClass = resolverHelper.CreateClass("MyClass");
myClass.AddMethod("MyMethod");
resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
}
示例3: CreateResolver
void CreateResolver()
{
resolverHelper = new PythonResolverTestsHelper();
myClass = resolverHelper.CreateClass("MyClass");
myMethod = myClass.AddMethod("MyMethod");
myMethod.ReturnType = new DefaultReturnType(myClass);
resolverHelper.ProjectContent.SetClassToReturnFromGetClass("MyClass", myClass);
}
示例4: AddMethod_PassedMethodName_ReturnsMethodWithExpectedName
public void AddMethod_PassedMethodName_ReturnsMethodWithExpectedName()
{
MockClass c = new MockClass();
IMethod myMethod = c.AddMethod("MyMethod");
string name = myMethod.Name;
Assert.AreEqual("MyMethod", name);
}
示例5: AddMethod_PassedName_AddsMethodToClass
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);
}