本文整理汇总了C#中IFakeObjectCall类的典型用法代码示例。如果您正苦于以下问题:C# IFakeObjectCall类的具体用法?C# IFakeObjectCall怎么用?C# IFakeObjectCall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFakeObjectCall类属于命名空间,在下文中一共展示了IFakeObjectCall类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Matches
/// <summary>
/// Matches the specified call against the expression.
/// </summary>
/// <param name="call">The call to match.</param>
/// <returns>True if the call is matched by the expression.</returns>
public virtual bool Matches(IFakeObjectCall call)
{
Guard.AgainstNull(call, "call");
return this.InvokesSameMethodOnTarget(call.FakedObject.GetType(), call.Method, this.Method)
&& this.ArgumentsMatches(call.Arguments);
}
开发者ID:bluePlayer,项目名称:FakeItEasy,代码行数:12,代码来源:ExpressionCallMatcher.cs
示例2: GetCanceledTokens
private static IEnumerable<CancellationToken> GetCanceledTokens(IFakeObjectCall call)
{
return call.Method.GetParameters()
.Select((param, index) => new { param, index })
.Where(x => x.param.ParameterType == typeof(CancellationToken))
.Select(x => (CancellationToken)call.Arguments[x.index])
.Where(token => token.IsCancellationRequested);
}
开发者ID:adamralph,项目名称:FakeItEasy,代码行数:8,代码来源:FakeManager.CancellationRule.cs
示例3: OnIsApplicableTo
protected override bool OnIsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return
this.argumentsPredicate(fakeObjectCall.Arguments) &&
(this.ApplicableToMembersWithReturnType == null
|| (this.ApplicableToMembersWithReturnType == fakeObjectCall.Method.ReturnType)
|| (this.ApplicableToAllNonVoidReturnTypes && fakeObjectCall.Method.ReturnType != typeof(void)));
}
开发者ID:bman61,项目名称:FakeItEasy,代码行数:8,代码来源:AnyCallCallRule.cs
示例4: GetFakeErrors
private void GetFakeErrors(IFakeObjectCall obj)
{
var errors = (Dictionary<string, ErrorRecord>)obj.Arguments[2];
for (var i = 0; i < _given.ExpectedErrorCount; i++)
{
errors.Add(i.ToString(), Random.ErrorRecord);
}
}
开发者ID:OpenMagic,项目名称:ElmahMagic.Repository,代码行数:9,代码来源:GetPagesOfErrorsFromTheRepositorySteps.cs
示例5: GetDescription
/// <summary>
/// Gets a human readable description of the specified
/// fake object call.
/// </summary>
/// <param name="call">The call to get a description for.</param>
/// <returns>A description of the call.</returns>
public string GetDescription(IFakeObjectCall call)
{
var builder = new StringBuilder();
builder
.Append(this.fakeManagerAccessor.GetFakeManager(call.FakedObject).FakeObjectType)
.Append(".");
AppendMethodName(builder, call.Method);
this.AppendArgumentsList(builder, call);
return builder.ToString();
}
开发者ID:huoxudong125,项目名称:FakeItEasy,代码行数:20,代码来源:DefaultFakeObjectCallFormatter.cs
示例6: OnIsApplicableTo
protected override bool OnIsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return this.ExpressionMatcher.Matches(fakeObjectCall);
}
开发者ID:bman61,项目名称:FakeItEasy,代码行数:4,代码来源:ExpressionCallRule.cs
示例7: OnIsApplicableTo
protected abstract bool OnIsApplicableTo(IFakeObjectCall fakeObjectCall);
开发者ID:bverburg,项目名称:FakeItEasy,代码行数:1,代码来源:BuildableCallRule.cs
示例8: IsApplicableTo
/// <summary>
/// Gets if this rule is applicable to the specified call.
/// </summary>
/// <param name="fakeObjectCall">The call to validate.</param>
/// <returns>True if the rule applies to the call.</returns>
public virtual bool IsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return this.wherePredicates.All(x => x.Item1.Invoke(fakeObjectCall))
&& this.OnIsApplicableTo(fakeObjectCall);
}
开发者ID:bverburg,项目名称:FakeItEasy,代码行数:10,代码来源:BuildableCallRule.cs
示例9: IsApplicableTo
public bool IsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return this.IsPropertySetter(fakeObjectCall) || this.IsPropertyGetter(fakeObjectCall);
}
开发者ID:patrik-hagne,项目名称:FakeItEasy,代码行数:4,代码来源:FakeManager.PropertyBehaviorRule.cs
示例10: MakeEqualCopy
private static IFakeObjectCall MakeEqualCopy(IFakeObjectCall call)
{
var copy = A.Fake<IFakeObjectCall>();
A.CallTo(() => copy.Method).Returns(call.Method);
A.CallTo(() => copy.Arguments).Returns(call.Arguments);
A.CallTo(() => copy.FakedObject).Returns(call.FakedObject);
return copy;
}
开发者ID:patrik-hagne,项目名称:FakeItEasy,代码行数:10,代码来源:FakeCallEqualityComparerTests.cs
示例11: GetOutputArgumentsForCall
private static IEnumerable<object> GetOutputArgumentsForCall(IFakeObjectCall call)
{
return
from valueAndParameterInfo in call.Method.GetParameters().Zip(call.Arguments.AsEnumerable())
where valueAndParameterInfo.Item1.ParameterType.IsByRef
select valueAndParameterInfo.Item2;
}
开发者ID:patrik-hagne,项目名称:FakeItEasy,代码行数:7,代码来源:RecordingManager.cs
示例12: GetOutputArgumentsForCall
private static IEnumerable<object> GetOutputArgumentsForCall(IFakeObjectCall call)
{
return
from valueAndParameterInfo in call.Method.GetParameters().Zip(
call.Arguments.AsEnumerable(),
(parameter, argument) => new { parameter.ParameterType, Argument = argument })
where valueAndParameterInfo.ParameterType.IsByRef
select valueAndParameterInfo.Argument;
}
开发者ID:huoxudong125,项目名称:FakeItEasy,代码行数:9,代码来源:RecordingManager.cs
示例13: GetArgumentValueInfos
private static ArgumentValueInfo[] GetArgumentValueInfos(IFakeObjectCall call)
{
return
(from argument in
call.Method.GetParameters()
.Zip(call.Arguments, (parameter, value) => new { parameter.Name, Value = value })
select new ArgumentValueInfo
{
ArgumentName = argument.Name,
ArgumentValue = argument.Value
}).ToArray();
}
开发者ID:huoxudong125,项目名称:FakeItEasy,代码行数:12,代码来源:DefaultFakeObjectCallFormatter.cs
示例14: OnIsApplicableTo
protected override bool OnIsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return
this.argumentsPredicate(fakeObjectCall.Arguments) &&
(this.ApplicableToMembersWithReturnType == null || this.ApplicableToMembersWithReturnType.Equals(fakeObjectCall.Method.ReturnType));
}
开发者ID:rajeshpillai,项目名称:FakeItEasy,代码行数:6,代码来源:AnyCallCallRule.cs
示例15: IsObjetMethod
private static bool IsObjetMethod(IFakeObjectCall fakeObjectCall)
{
return ObjectMethodsMethodHandles.Contains(fakeObjectCall.Method.MethodHandle);
}
开发者ID:NameOfTheDragon,项目名称:FakeItEasy,代码行数:4,代码来源:FakeManager.ObjectMemberRule.cs
示例16: IsApplicableTo
public bool IsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return IsObjetMethod(fakeObjectCall);
}
开发者ID:NameOfTheDragon,项目名称:FakeItEasy,代码行数:4,代码来源:FakeManager.ObjectMemberRule.cs
示例17: GetParametersString
private static string GetParametersString(IFakeObjectCall fakeObjectCall)
{
return fakeObjectCall.Arguments.ToCollectionString(x => GetArgumentAsString(x), ", ");
}
开发者ID:uday4347,项目名称:FakeItEasy,代码行数:4,代码来源:Helpers.cs
示例18: IsApplicableTo
/// <summary>
/// Gets whether this interceptor is applicable to the specified
/// call, if true is returned the Apply-method of the interceptor will
/// be called.
/// </summary>
/// <param name="fakeObjectCall">The call to check for applicability.</param>
/// <returns>True if the interceptor is applicable.</returns>
public bool IsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return true;
}
开发者ID:NameOfTheDragon,项目名称:FakeItEasy,代码行数:11,代码来源:WrappedObjectRule.cs
示例19: GetEventCall
public static EventCall GetEventCall(
IFakeObjectCall fakeObjectCall)
{
var eventInfo = GetEvent(fakeObjectCall.Method);
return new EventCall
{
Event = eventInfo,
CallingMethod = fakeObjectCall.Method,
EventHandler = (Delegate)fakeObjectCall.Arguments[0],
};
}
开发者ID:IharBury,项目名称:FakeItEasy,代码行数:12,代码来源:FakeManager.EventRule.cs
示例20: IsApplicableTo
/// <summary>
/// Gets whether this interceptor is applicable to the specified
/// call, if true is returned the Apply-method of the interceptor will
/// be called.
/// </summary>
/// <param name="fakeObjectCall">The call to check for applicability.</param>
/// <returns>True if the interceptor is applicable.</returns>
public bool IsApplicableTo(IFakeObjectCall fakeObjectCall)
{
return this.wrappedRule.IsApplicableTo(fakeObjectCall);
}
开发者ID:adamralph,项目名称:FakeItEasy,代码行数:11,代码来源:SelfInitializationRule.cs
注:本文中的IFakeObjectCall类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论