Ejemplo n.º 1
0
        /// <summary>
        ///     Called when a value is written to the property.
        ///     This implementation logs before and after the value has been written, along with any exceptions thrown.
        /// </summary>
        /// <param name="mockInfo">Information about the mock through which the value is written.</param>
        /// <param name="value">The value being written.</param>
        public override void Set(IMockInfo mockInfo, TValue value)
        {
            _logContext.LogBeforePropertySet(mockInfo, value);
            try
            {
                base.Set(mockInfo, value);
            }
            catch (Exception exception)
            {
                _logContext.LogPropertySetException(mockInfo, exception);
                throw;
            }

            _logContext.LogAfterPropertySet(mockInfo);
        }