示例#1
0
        /// <summary>
        /// A Constructor
        /// </summary>
        /// <param name="drt">An instance of the DrtBase</param>
        /// <param name="instance">An instance of the tested object like InkCanvas</param>
        /// <param name="propertyName">The name of the tested property like EditingMode</param>
        /// <param name="callback">An instance of the IEventsForwading interface. If not null, the Changed/Changing Events will be forward to the test unit's handler.</param>
        protected PropertyTestUnit(DrtBase drt, object instance, string propertyName, IEventsForwading callback)
            : base(drt)
        {
            _callback     = callback;
            _instance     = instance;
            _propertyInfo = _instance.GetType().GetProperty(propertyName);
            _propertyName = propertyName;

            Drt.Assert(_propertyInfo != null, string.Format("The {0} type doesn't have the property - {1}.", _instance.GetType(), propertyName));
        }
示例#2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="drt">An instance of the DrtBase</param>
 /// <param name="instance">An instance of the tested object</param>
 /// <param name="propertyName">The property name of the tested property</param>
 /// <param name="newValue">The value which is set to the property.</param>
 /// <param name="callback">The interface which is used for forwarding events</param>
 /// <param name="changingCancelling">A flag which indicates whether cancels the changing event.</param>
 public AccessPropertyTest(DrtBase drt, object instance, string propertyName, object newValue, IEventsForwading callback, bool changingCancelling)
     : base(drt, instance, propertyName, callback)
 {
     _newValue           = newValue;
     _changingCancelling = changingCancelling;
 }