internal static Guid Add(ShimmedMember member) { var referenceGuid = Guid.NewGuid(); _library.Add(referenceGuid, member); return(referenceGuid); }
public static void SetRunningMethod(string referenceGuidString) { var referenceGuid = Guid.Parse(referenceGuidString); var record = _library.First(l => l.Key.Equals(referenceGuid)); _currentRunningMember = record.Value; }
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; } }
public static void ClearRunningMethod() { _currentRunningMember = null; }