Describes the injection of a property.
Inheritance: IDirective
        public void CreatesTargetForProperty()
        {
            var method = typeof(Dummy).GetProperty("Foo");
            PropertyInjector injector = delegate { };

            directive = new PropertyInjectionDirective(method, injector);

            directive.Target.Name.Should().Be("Foo");
            directive.Target.Type.Should().Be(typeof(int));
        }
        /// <summary>
        /// Applies user supplied override values to instance properties.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="reference">A reference to the instance being activated.</param>
        /// <param name="propertyValues">The parameter override value accessors.</param>
        private void AssignPropertyOverrides(IContext context, InstanceReference reference, IList<IPropertyValue> propertyValues)
        {
            var properties = reference.Instance.GetType().GetRuntimeProperties().FilterPublic(Settings.InjectNonPublic);

            foreach (var propertyValue in propertyValues)
            {
                string propertyName = propertyValue.Name;
                var propertyInfo = properties.FirstOrDefault(property => string.Equals(property.Name, propertyName, StringComparison.Ordinal));

                if (propertyInfo == null)
                {
                    throw new ActivationException(ExceptionFormatter.CouldNotResolvePropertyForValueInjection(context.Request, propertyName));
                }

                var target = new PropertyInjectionDirective(propertyInfo, this.InjectorFactory.Create(propertyInfo));
                object value = this.GetValue(context, target.Target, propertyValues);
                target.Injector(reference.Instance, value);
            }
        }
        /// <summary>
        /// Applies user supplied override values to instance properties.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="reference">A reference to the instance being activated.</param>
        /// <param name="propertyValues">The parameter ovverride value accessors.</param>
        private void AssignProperyOverrides( IContext context, InstanceReference reference, IEnumerable<IParameter> propertyValues )
        {
            var properties = reference.Instance.GetType().GetProperties( Flags );
            foreach (var propertyValue in propertyValues)
            {
                string propertyName = propertyValue.Name;
                var propertyInfo = properties
                    .Where(property => string.Equals(property.Name, propertyName, StringComparison.Ordinal))
                    .FirstOrDefault();

                if(propertyInfo == null)
                    throw new ActivationException(ExceptionFormatter.CouldNotResolveProperyForValueInjection(context.Request, propertyName));

                var target = new PropertyInjectionDirective( propertyInfo, InjectorFactory.Create( propertyInfo ) );
                object value = GetValue(context, target.Target);
                target.Injector(reference.Instance, value);
            }
        }