本文整理汇总了C#中Target.GetTargetMethodNoArgs方法的典型用法代码示例。如果您正苦于以下问题:C# Target.GetTargetMethodNoArgs方法的具体用法?C# Target.GetTargetMethodNoArgs怎么用?C# Target.GetTargetMethodNoArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Target
的用法示例。
在下文中一共展示了Target.GetTargetMethodNoArgs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProceedWithEmptyInterceptorChain
public void ProceedWithEmptyInterceptorChain()
{
Target target = new Target();
AbstractMethodInvocation join = CreateMethodInvocation(
null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new ArrayList());
string score = (string) join.Proceed();
Assert.AreEqual(Target.DefaultScore + Target.Suffix, score);
}
示例2: ToStringWithoutArguments
public void ToStringWithoutArguments()
{
Target target = new Target();
AbstractMethodInvocation join = CreateMethodInvocation(
null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new ArrayList());
CheckToStringDoesntThrowAnException(join);
}
示例3: ValidInvocation
public void ValidInvocation()
{/*
Target target = new Target();
MockRepository repository = new MockRepository();
IMethodInterceptor interceptor = (IMethodInterceptor) repository.CreateMock(typeof (IMethodInterceptor));
AbstractMethodInvocation join = CreateMethodInvocation(
null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new object[] { interceptor });
Expect.Call(interceptor.Invoke(join)).Return(target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture));
repository.ReplayAll();
string score = (string) join.Proceed();
Assert.AreEqual(target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture) + Target.Suffix, score);
repository.VerifyAll();
*/
Target target = new Target();
IMethodInterceptor mock = (IMethodInterceptor) mocks.CreateMock(typeof(IMethodInterceptor));
AbstractMethodInvocation join = CreateMethodInvocation(
null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new object[] { mock });
Expect.Call(mock.Invoke(null)).IgnoreArguments().Return(target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture));
mocks.ReplayAll();
string score = (string) join.Proceed();
Assert.AreEqual(Target.DefaultScore.ToLower(CultureInfo.InvariantCulture) + Target.Suffix, score);
mocks.VerifyAll();
}