You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicinterfaceIFace{}publicclassA:IFace{}publicclassADecorator:IFace{publicIFaceInner{get;}publicADecorator(IFaceinner){Inner=inner;}}[Fact]publicvoidCanRegisterSingletonDecoratorToScoped(){varc=newContainer();c.RegisterMany<A>(Reuse.Scoped);c.Register<IFace,ADecorator>(Reuse.Singleton,setup:Setup.Decorator);using(vars1=c.OpenScope()){varf=s1.Resolve<IFace>();f.Should().BeOfType<ADecorator>();s1.Resolve<A>().Should().Be(((ADecorator)f).Inner);}using(vars2=c.OpenScope()){varf=s2.Resolve<IFace>();f.Should().BeOfType<ADecorator>();s2.Resolve<A>().Should().Be(((ADecorator)f).Inner);//throws because inner is A from the s1 scope!!!}}
I just accidentally hit this because I was changing a couple of reuses.
This should ideally fail with verification!
The text was updated successfully, but these errors were encountered:
consider this testcase:
I just accidentally hit this because I was changing a couple of reuses.
This should ideally fail with verification!
The text was updated successfully, but these errors were encountered: