Exemple #1
0
 /// <summary>
 /// Raises the <see cref="PropertyValueException"/> event.
 /// </summary>
 /// <param name="valueExceptionEventArgs">The <see cref="ValueExceptionEventArgs"/> instance containing the event data.</param>
 protected virtual void OnPropertyValueException(ValueExceptionEventArgs valueExceptionEventArgs)
 {
     if (valueExceptionEventArgs == null)
     {
         throw new ArgumentNullException(nameof(valueExceptionEventArgs));
     }
     if (PropertyValueException != null)
     {
         PropertyValueException(this, valueExceptionEventArgs);
     }
 }
Exemple #2
0
 /// <summary>
 ///     Raises the <see cref="PropertyValueException" /> event.
 /// </summary>
 /// <param name="e">The <see cref="ValueExceptionEventArgs" /> instance containing the event data.</param>
 protected virtual void OnPropertyValueException(ValueExceptionEventArgs e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (PropertyValueException != null)
     {
         PropertyValueException(this, e);
     }
 }
Exemple #3
0
        public void ShouldAssignAllPropertiesFromConstructor()
        {
            PropertyItemValueMock value     = new PropertyItemValueMock();
            Exception             exception = new Exception();

            ValueExceptionEventArgs arguments = new ValueExceptionEventArgs("message", value, ValueExceptionSource.Get, exception);

            Assert.AreEqual <string>("message", arguments.Message);
            Assert.AreEqual <PropertyItemValue>(value, arguments.PropertyValue);
            Assert.AreEqual <ValueExceptionSource>(ValueExceptionSource.Get, arguments.Source);
            Assert.AreEqual <Exception>(exception, arguments.Exception);
        }