Esempio n. 1
0
        internal static Guid Add(ShimmedMember member)
        {
            var referenceGuid = Guid.NewGuid();

            _library.Add(referenceGuid, member);
            return(referenceGuid);
        }
Esempio n. 2
0
        public static void SetRunningMethod(string referenceGuidString)
        {
            var referenceGuid = Guid.Parse(referenceGuidString);
            var record        = _library.First(l => l.Key.Equals(referenceGuid));

            _currentRunningMember = record.Value;
        }
Esempio n. 3
0
        public ShimReplacement(ShimmedMember parent, Type returnType, object returnValue, bool isPassThrough = false)
        {
            Parent         = parent ?? throw new ArgumentNullException(nameof(parent));
            ReturnType     = returnType ?? throw new ArgumentNullException(nameof(ReturnType));
            IsPassThrough  = isPassThrough;
            HasReturnValue = ShimmedMemberHelper.MemberCanReturn(parent.Member) && ReturnType != typeof(void);

            if (HasReturnValue)
            {
                ReturnValue = returnValue;
            }
        }
Esempio n. 4
0
 public static void ClearRunningMethod()
 {
     _currentRunningMember = null;
 }