public void ProvideValueExceptions()
        {
            var stubServiceProvider = MockServiceProvider.Instance;

            var bindEvent = new BindEventHandler();
            var viewModel = new _TestBindEventHandler();

            bindEvent.Source = viewModel;

            // ReSharper disable AccessToModifiedClosure
            UnitTestInternal.AssertThrows(typeof(ArgumentException), () => bindEvent.ProvideValue(stubServiceProvider),
                                          // ReSharper restore AccessToModifiedClosure
                                          "ProvideValueExceptions - expected exception - ArgumentException");
            bindEvent.PropertyName = "ButtonClickPropDelegate";
            bindEvent.MethodName   = "ButtonClick";

            // ReSharper disable AccessToModifiedClosure
            UnitTestInternal.AssertThrows(typeof(ArgumentException), () => bindEvent.ProvideValue(stubServiceProvider),
                                          // ReSharper restore AccessToModifiedClosure
                                          "ProvideValueExceptions - expected exception - ArgumentException");

            bindEvent.PropertyName = null;
            bindEvent.MethodName   = null;

            stubServiceProvider = MockServiceProvider.Instance;

            UnitTestInternal.AssertThrows(typeof(ArgumentException), () => bindEvent.ProvideValue(stubServiceProvider),
                                          "ProvideValueExceptions - expected exception - ArgumentException");
        }
        public void BindEventHandlerByMethodName()
        {
            var stubServiceProvider = MockServiceProvider.Instance;

            var bindEvent = new BindEventHandler();
            var viewModel = new _TestBindEventHandler();

            bindEvent.Source     = viewModel;
            bindEvent.MethodName = "ButtonClick";

            var bindResolve = bindEvent.ProvideValue(stubServiceProvider);

            FakeTargetHandler += (RoutedEventHandler)bindResolve;
            FakeTargetHandler(null, null);
            Assert.Equal(viewModel.Count, int.MaxValue);
            FakeTargetHandler -= (RoutedEventHandler)bindResolve;
        }