当前位置: 首页>>代码示例>>C#>>正文


C# IFakeObjectCall类代码示例

本文整理汇总了C#中IFakeObjectCall的典型用法代码示例。如果您正苦于以下问题:C# IFakeObjectCall类的具体用法?C# IFakeObjectCall怎么用?C# IFakeObjectCall使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IFakeObjectCall类属于命名空间,在下文中一共展示了IFakeObjectCall类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的IFakeObjectCall类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。