/// <summary> /// Create an instance of <see cref="DependencyOverride"/> to override /// the given type with the given value. /// </summary> /// <param name="typeToConstruct">Type of the dependency.</param> /// <param name="dependencyValue">Value to use.</param> public DependencyOverride(Type typeToConstruct, object dependencyValue) { this.typeToConstruct = typeToConstruct; this.dependencyValue = InjectionParameterValue.ToParameter(dependencyValue); }
/// <summary> /// Create an instance of <see cref="PropertyOverride"/>. /// </summary> /// <param name="propertyName">The property name.</param> /// <param name="propertyValue">Value to use for the property.</param> public PropertyOverride(string propertyName, object propertyValue) { this.propertyName = propertyName; this.propertyValue = InjectionParameterValue.ToParameter(propertyValue); }
/// <summary> /// Construct a new <see cref="ParameterOverride"/> object that will /// override the given named constructor parameter, and pass the given /// value. /// </summary> /// <param name="parameterName">Name of the constructor parameter.</param> /// <param name="parameterValue">Value to pass for the constructor.</param> public ParameterOverride(string parameterName, object parameterValue) { this.parameterName = parameterName; this.parameterValue = InjectionParameterValue.ToParameter(parameterValue); }