Beispiel #1
0
        public void SelectInterceptors_returns_XPathInterceptor_for_properties_marked_with_XPath_attribute()
        {
            var subject      = new InterceptorSelector();
            var interceptors = new IInterceptor[] { new SelectorInterceptor(), new XPathInterceptor() };

            var methodInfo = typeof(FakePageObject).GetProperty(nameof(FakePageObject.XPathForElementHandleArray)).GetMethod;
            var result     = subject.SelectInterceptors(null, methodInfo, interceptors);

            Assert.IsType <XPathInterceptor>(result.Single());

            methodInfo = typeof(FakeElementObject).GetProperty(nameof(FakeElementObject.XPathForElementHandleArray)).GetMethod;
            result     = subject.SelectInterceptors(null, methodInfo, interceptors);
            Assert.IsType <XPathInterceptor>(result.Single());
        }
Beispiel #2
0
        public void SelectInterceptors_returns_other_interceptors_for_properties_not_marked_with_Selector_or_XPath_attribute()
        {
            var subject      = new InterceptorSelector();
            var interceptors = new IInterceptor[] { new SelectorInterceptor(), new XPathInterceptor(), new StandardInterceptor() };

            var methodInfo = typeof(string).GetMethod(nameof(string.GetTypeCode));
            var result     = subject.SelectInterceptors(null, methodInfo, interceptors);

            Assert.Same(interceptors.Last(), result.Single());
        }