Ejemplo n.º 1
0
        /// <summary>
        ///     Called when a value is read from the property.
        ///     This implementation logs before and after the value has been read, along with any exceptions thrown.
        /// </summary>
        /// <param name="mockInfo">Information about the mock through which the value is read.</param>
        /// <returns>The value being read.</returns>
        public override TValue Get(IMockInfo mockInfo)
        {
            _logContext.LogBeforePropertyGet(mockInfo);
            TValue result;

            try
            {
                result = base.Get(mockInfo);
            }
            catch (Exception exception)
            {
                _logContext.LogPropertyGetException(mockInfo, exception);
                throw;
            }

            _logContext.LogAfterPropertyGet(mockInfo, result);
            return(result);
        }