/// <summary>
        /// Asserts that an object has raised the <see cref="INotifyPropertyChanged.PropertyChanged"/> event for a particular property.
        /// </summary>
        /// <param name="propertyExpression">
        /// A lambda expression referring to the property for which the property changed event should have been raised, or
        /// <c>null</c> to refer to all properties.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="AssertionExtensions.Monitor"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public IEventRecorder RaisePropertyChangeFor(Expression <Func <T, object> > propertyExpression,
                                                     string because = "", params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = monitor.GetEventRecorder(PropertyChangedEventName);
            string         propertyName  = propertyExpression?.GetPropertyInfo().Name;

            if (!eventRecorder.Any())
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Expected object {0} to raise event {1} for property {2}{reason}, but it did not.",
                          monitor.Subject, PropertyChangedEventName, propertyName);
            }

            return(eventRecorder.WithArgs <PropertyChangedEventArgs>(args => args.PropertyName == propertyName));
        }
        /// <summary>
        /// Asserts that an object has raised the <see cref="INotifyPropertyChanged.PropertyChanged"/> event for a particular property.
        /// </summary>
        /// <param name="eventSource">The object exposing the event.</param>
        /// <param name="propertyExpression">
        /// A lambda expression referring to the property for which the property changed event should have been raised, or
        /// <c>null</c> to refer to all properties.
        /// </param>
        /// <param name="because">
        /// A formatted phrase explaining why the assertion should be satisfied. If the phrase does not
        /// start with the word <i>because</i>, it is prepended to the message.
        /// </param>
        /// <param name="becauseArgs">
        /// Zero or more values to use for filling in any <see cref="string.Format(string,object[])"/> compatible placeholders.
        /// </param>
        /// <remarks>
        /// You must call <see cref="AssertionExtensions.MonitorEvents"/> on the same object prior to this call so that Fluent Assertions can
        /// subscribe for the events of the object.
        /// </remarks>
        public static IEventRecorder ShouldRaisePropertyChangeFor <T>(
            this T eventSource, Expression <Func <T, object> > propertyExpression,
            string because, params object[] becauseArgs)
        {
            IEventRecorder eventRecorder = EventMonitor.Get(eventSource).GetEventRecorder(PropertyChangedEventName);
            string         propertyName  = (propertyExpression != null) ? propertyExpression.GetPropertyInfo().Name : null;

            if (!eventRecorder.Any())
            {
                Execute.Assertion
                .BecauseOf(because, becauseArgs)
                .FailWith("Expected object {0} to raise event {1} for property {2}{reason}, but it did not.",
                          eventSource, PropertyChangedEventName, propertyName);
            }

            return(eventRecorder.WithArgs <PropertyChangedEventArgs>(args => args.PropertyName == propertyName));
        }