/// <summary> /// Configure behaviour to inject with the monkey policy. /// </summary> /// <param name="options">The configuration object.</param> /// <param name="behaviour">A delegate representing the behaviour to inject.</param> public static InjectBehaviourOptions Behaviour(this InjectBehaviourOptions options, Action behaviour) => Behaviour(options, (_, __) => behaviour());
/// <summary> /// Configure behaviour to inject with the monkey policy. /// </summary> /// <param name="options">The configuration object.</param> /// <param name="behaviour">A delegate representing the behaviour to inject.</param> public static InjectBehaviourOptions Behaviour(this InjectBehaviourOptions options, Action <Context, CancellationToken> behaviour) { options.BehaviourInternal = behaviour; return(options); }
internal InjectBehaviourPolicy(InjectBehaviourOptions options) : base(options.InjectionRate, options.Enabled) { _behaviour = options.BehaviourInternal ?? throw new ArgumentNullException(nameof(options.BehaviourInternal)); }