Sorry I didn't see your last post... So it is just an order problem...
I know what your are saying but the way it acts is not quite the way that I would naturally think it would work. Normally I would have thought that no matter what order the registrations happen the result would be the same (in terms of keyed vs unkeyed components). Cheers Anthony On May 24, 7:05 pm, vdhant <[email protected]> wrote: > Whoops that wan't suppose to go up yet... > > Hi Tuna > Thanks for the reply. > Sorry to say but what you are saying doesn't quite make sense to me... > > Test Case 1: > I am telling it that the keyed version should be Transitional and any > default version should be a Singlton... > The test case I have reflects this exspectation. > Assert.AreSame(singleton, singleton1); >>FAIL > Assert.AreNotSame(instance, instance1); >>PASS > But for some reason castle is saying that both registrations are > Transitional.... > > Test Case 2: > I am telling it that the keyed version should be Singlton and any > default version should be a Transitional... > The test case I have reflects this exspectation. > Assert.AreSame(singleton, singleton1); >>PASS > Assert.AreNotSame(instance, instance1); >>FAIL > But for some reason castle is saying that both registrations are > Singlton.... > > Test Case 3: > When I use a key for both versions it works correctly... > Assert.AreSame(singleton, singleton1); >>PASS > Assert.AreNotSame(instance, instance1); >>PASS > It gets it right here... > > So in short this test case to me shows that I can't setup a regault > lifestyle for a registrations that have keys if a keyed version of the > same registration exists... is that correct???? > Cheers > Anthony > > On May 24, 6:55 pm, vdhant <[email protected]> wrote: > > > Hi Tuna > > Thanks for the reply. > > Sorry to say but what you are saying doesn't quite make sense to me... > > > Test Case 1: > > > Assert.AreSame(singleton, singleton1); > > Assert.AreNotSame(instance, instance1); > > > On May 24, 5:28 pm, Tuna Toksoz <[email protected]> wrote: > > > > Test Case 1: You're using Transient so they won't be same at all. You'll > > > get > > > different instances > > > Test Case 2: Fails because when you ask IMyInterface, you'll get the > > > component registered first. > > > Test Case 3 is what you see from above reasons. > > > > Tuna Toksöz > > > Eternal sunshine of the open source mind. > > > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt... > > > > On Sun, May 24, 2009 at 9:35 AM, vdhant <[email protected]> wrote: > > > > > var singleton = container.Resolve<IMyInterface>(); > > > > var singleton1 = container.Resolve<IMyInterface>(); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
