Пример #1
0
 /// <summary>
 /// Initializes a new instance of FaultRule class with the specified method, condition and fault.
 /// </summary>
 /// <param name="method">The signature of the method where the fault should be injected.</param>
 /// <param name="condition">The condition that defines when the fault should occur.</param>
 /// <param name="fault">The fault to be injected.</param>
 public FaultRule(MethodBase method, ICondition condition, IFault fault)
     : this(MethodSignatureTranslator.GetCSharpMethodString(method), condition, fault)
 {
     //  Nothing
 }
Пример #2
0
 /// <summary>
 /// A built-in condition which triggers a fault if the faulted method is called by a specified method.</summary>
 /// <param name="caller">The target method's caller.
 /// </param>
 public static ICondition TriggerIfCalledBy(MethodBase caller)
 {
     return(new TriggerIfCalledBy(MethodSignatureTranslator.GetCSharpMethodString(caller)));
 }
Пример #3
0
 /// <summary>
 /// A built-in condition which triggers a fault if the current call stack contains a specified method.
 /// </summary>
 /// <param name="method">A method in the stack below the target method.
 /// </param>
 public static ICondition TriggerIfStackContains(MethodBase method)
 {
     return(new TriggerIfStackContains(MethodSignatureTranslator.GetCSharpMethodString(method)));
 }
Пример #4
0
 public static ICondition TriggerOnNthCallBy(int n, MethodBase caller)
 {
     return(new TriggerOnNthCallBy(n, MethodSignatureTranslator.GetCSharpMethodString(caller)));
 }