public void Context() { GenericEventConstraintHandler.Called = false; WhenCalling <IAssemblyLocator>(x => x.GetAssemblies()).Return(new[] { Assembly.GetExecutingAssembly() }); var typeFinder = new TypeFinder <TestEventBase>(); var type = typeof(OuterGeneric <EntityOne>); var handlerType = typeFinder.GetConstraintHandlerType(type); var eventConstraintHandler = Activator.CreateInstance(handlerType) as IEventConstraintHandler; eventConstraintHandler.Allow(new OuterGeneric <EntityOne>(), null, null); }