public void Discover_runs_and_resolves_the_ActionInvokingRegistrar_Register_method() { using (var container = new UnityContainer()) { var callCount = 0; void RegistrationAction(IUnityContainer c) { callCount++; c.RegisterType <TestingNestedClass>(); } container.RegisterInstance((Action <IUnityContainer>)RegistrationAction); var discoverer = new IocRegistrarTypeDiscoverer(); discoverer.Discover(container); Assert.That(callCount, Is.EqualTo(1)); Assert.That( container.Registrations.Any(r => r.RegisteredType == typeof(TestingNestedClass)), Is.True, $"Expected the registration action to be called and have registered the {typeof(TestingNestedClass).FullName} type."); } }