We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c468f6 commit a398dcaCopy full SHA for a398dca
test/Autofac.Test/Features/OpenGenerics/ComplexGenericsTests.cs
@@ -341,6 +341,17 @@ public void ResolveTypeFromOpenGenericInterfaceTypeParameterIsInterfaceWithConst
341
var instance = container.Resolve<INested<ISimpleInterface>>();
342
}
343
344
+ [Fact]
345
+ public void CheckGenericTypeIsRegisteredWhenNotSpecifyParameterType()
346
+ {
347
+ // Issue #1040: IsRegistered throws IndexOutOfRangeException for open generic type
348
+ var cb = new ContainerBuilder();
349
+ cb.RegisterGeneric(typeof(C<>));
350
+ var container = cb.Build();
351
+
352
+ Assert.False(container.IsRegistered(typeof(C<>)));
353
+ }
354
355
private class CNestedSimpleInterface : INested<ISimpleInterface>
356
{
357
0 commit comments