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
It's not the same as unitycontainer/interception#30, but perhaps it is related to each other. The following test is failed both for .NET Core and Framework. Look at the comments in the code to more information.
To Reproduce
[Test]publicvoidUnityTest(){for(vari=0;i<10000;i++){varcontainer=newUnityContainer().RegisterType<IFoo,Foo>().RegisterType<IBar,Bar>()// It's important the name is random.RegisterType<IBar,Bar>(Guid.NewGuid().ToString());varchild=container.CreateChildContainer().RegisterType<IFoo,Foo>(newContainerControlledLifetimeManager());varregistrations=child.Registrations.Where(r =>r.RegisteredType==typeof(IFoo)).ToList();Assert.IsNotNull(registrations.FirstOrDefault(r =>r.LifetimeManagerisContainerControlledLifetimeManager),"Singleton registration not found on iteration #"+i);// This check fails on random iteration, usually i < 300.// It passes for v.5.8.13 but fails for v.5.9.0 and later both for .NET Core and for Framework.Assert.IsNull(registrations.FirstOrDefault(r =>r.LifetimeManagerisTransientLifetimeManager),"Transient registration found on iteration #"+i);}}publicinterfaceIFoo{}publicclassFoo:IFoo{}publicinterfaceIBar{}publicclassBar:IBar{}
Expected behavior
There must be no transient registration in the child container, but it is on random iteration.
The text was updated successfully, but these errors were encountered:
`Entry.Next` should contain index+1 as assumed by the loop above.
This fixes invalid registration behavior as noted by (this issue)[unitycontainer#160]
Description
It's not the same as unitycontainer/interception#30, but perhaps it is related to each other. The following test is failed both for .NET Core and Framework. Look at the comments in the code to more information.
To Reproduce
Expected behavior
There must be no transient registration in the child container, but it is on random iteration.
The text was updated successfully, but these errors were encountered: