public SelectorPart(string selectorPart)
 {
     if (selectorPart.Contains(' '))
     {
         WrapperException.Throw(WrongSelector);
     }
 }
Example #2
0
        public void StripSpecifiedWrapperException()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

            WrapperException wrapper = new WrapperException(_exception);

            List <Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper).ToList();

            Assert.AreEqual(1, exceptions.Count);
            Assert.Contains(_exception, exceptions);
        }
        public void StripMultipleWrapperExceptions()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

            WrapperException          wrapper  = new WrapperException(_exception);
            TargetInvocationException wrapper2 = new TargetInvocationException(wrapper);

            List <Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper2).ToList();

            Assert.AreEqual(1, exceptions.Count);
            Assert.Contains(_exception, exceptions);
        }
Example #4
0
        protected override void OnVisualParentChanged(DependencyObject oldParent)
        {
            base.OnVisualParentChanged(oldParent);
            if (CapturingVisual != null)
            {
                CapturingVisual.PreviewMouseMove -= CapturingVisualPreviewMouseMove;
            }
            CapturingVisual = this.GetLastParent <FrameworkElement>();
            if (CapturingVisual == null)
            {
                WrapperException.Throw(NoSuitableParentException);
            }

            if (CapturingVisual != null)
            {
                CapturingVisual.PreviewMouseMove += CapturingVisualPreviewMouseMove;
            }
        }
        public void StripSpecifiedWrapperException()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

              WrapperException wrapper = new WrapperException(_exception);

              List<Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper).ToList();
              Assert.AreEqual(1, exceptions.Count);
              Assert.Contains(_exception, exceptions);
        }
        public void StripMultipleWrapperExceptions()
        {
            _client.AddWrapperExceptions(typeof(WrapperException));

              WrapperException wrapper = new WrapperException(_exception);
              TargetInvocationException wrapper2 = new TargetInvocationException(wrapper);

              List<Exception> exceptions = _client.ExposeStripWrapperExceptions(wrapper2).ToList();
              Assert.AreEqual(1, exceptions.Count);
              Assert.Contains(_exception, exceptions);
        }