本文整理汇总了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);
}