Ejemplo n.º 1
0
        /// <summary>
        ///     Called when the mocked method is called.
        ///     This implementation will select the alternative branch if the condition evaluates to <c>true</c>.
        /// </summary>
        /// <param name="mockInfo">Information about the mock through which the method is called.</param>
        /// <param name="param">The parameters used.</param>
        /// <returns>The returned result.</returns>
        public override TResult Call(IMockInfo mockInfo, ValueTuple param)
        {
            if (_condition?.Invoke(mockInfo.MockInstance) ?? false)
            {
                return(IfBranch.Call(mockInfo, param));
            }

            return(base.Call(mockInfo, param));
        }