Beispiel #1
0
 /// <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());
Beispiel #2
0
 /// <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);
 }
Beispiel #3
0
 internal InjectBehaviourPolicy(InjectBehaviourOptions options)
     : base(options.InjectionRate, options.Enabled)
 {
     _behaviour = options.BehaviourInternal ?? throw new ArgumentNullException(nameof(options.BehaviourInternal));
 }