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
{{ message }}
Repository navigation
Unity IoC fails specification test in Microsoft.Extensions.DependencyInjection.Specification #1503
The test relies on FakeDisposableCallbackOuterService class to resolve an enumerable IEnumerable<IFakeMultipleService> and later verifies sequence of disposal against sequence of resolution.
Unity is using lazy resolution for the enumerable dependencies, meaning it does not resolve the dependency until the enumerable is actually requested by the iterator.
As you can see on this line the enumerable is never iterated. In other words, these IFakeMultipleService instances are never resolved.
As consequence, when disposed, these instances are not in the disposed list and so test fails.
Expected behavior
The test should not assume that IEnumerable already created these dependencies and instead should enumerate it into an array explicitly:
Activity