Craig Neuwirt pisze:
> So will this still work with interface proxy without target?
like a charm.

I added these two tests to check for that and they both pass. Any other 
scenario you had in mind?


        [Test]
        public void SelectorWorksForInterfaceProxyWithoutTarget()
        {
            var options = new ProxyGenerationOptions
                              {
                                  Selector = new 
TypeInterceptorSelector<ReturnNewTInterceptor>()
                              };
            var proxy =
                
generator.CreateInterfaceProxyWithoutTarget(typeof(ISimpleInterface), 
new Type[0], options,
                                                            new 
ReturnNewTInterceptor()) as ISimpleInterface;
            Assert.IsNotNull(proxy);
            var i = proxy.Do();
            Assert.AreEqual(0, i);
        }

        [Test]
        [ExpectedException(typeof(NotImplementedException), 
ExpectedMessage = "This is a DynamicProxy2 error: the interceptor 
attempted to 'Proceed' for a method without a target, for example, an 
interface method or an abstract method")]
        public void 
ProxyThrowsForInterfaceProxyWithoutTargetWhenSelectorSelectsNoInterceptor()
        {
            var options = new ProxyGenerationOptions
            {
                Selector = new TypeInterceptorSelector<AddTwoInterceptor>()
            };
            var interceptor = new CallCountingInterceptor();
            var proxy =
                
generator.CreateInterfaceProxyWithoutTarget(typeof(ISimpleInterface), 
new Type[0], options,
                                                            interceptor) 
as ISimpleInterface;
            Assert.IsNotNull(proxy);
            var i = proxy.Do();

        }
>
> 2009/1/18 Jonathon Rossi <[email protected] <mailto:[email protected]>>
>
>     Applied in r5522. Also removed UseSelector property as indicated.
>
>     Please use tabs next time :)
>
>     Thanks. If you find any problems let me know so we can get them
>     sorted.
>
>
>     On Wed, Jan 14, 2009 at 8:49 AM, Krzysztof Koźmic
>     <[email protected] <mailto:[email protected]>>
>     wrote:
>
>
>         Hi,
>
>         I finally found some time to sit and re-implement the iinterceptor
>         selector support in DP like we discussed in the other thread.
>         I uploaded the patch here:
>         
> http://support.castleproject.org/projects/DYNPROXY/issues/view/DYNPROXY-ISSUE-37
>         (the *_byref file)
>         along with screenshot that shows how generated code looks now.
>         Please review it and if you have any comments or find any
>         issues with
>         the patch, ping me.
>
>         PS
>
>         After I uploaded it I remembered that I forgot to remove the
>         UseSelector
>         property. If you're going to apply the patch, please remove it
>         first (it
>         affects few classes and tests so they will have to be updated
>         as well)
>
>         cheers
>
>         Krzysztof
>
>
>
>
>
>     -- 
>     Jonathon Rossi
>
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to