string GetSkipReason(SkipBehavior skipBehavior, Case @case) { try { return(skipBehavior.GetSkipReason(@case)); } catch (Exception exception) { throw new Exception( "Exception thrown while attempting to get a custom case-skipped reason. " + "Check the inner exception for more details.", exception); } }
bool SkipCase(SkipBehavior skipBehavior, Case @case) { try { return(skipBehavior.SkipCase(@case)); } catch (Exception exception) { throw new Exception( "Exception thrown while attempting to run a custom case-skipping predicate. " + "Check the inner exception for more details.", exception); } }
private void PickBehavior() { int m_behavior = Random.Range(0, 3); switch (m_behavior) { case 0: m_skipBehavior = SkipBehavior.BasicBehavior; break; case 1: m_skipBehavior = SkipBehavior.StrategicBehavior; break; case 2: m_skipBehavior = SkipBehavior.CopyBehavior; break; default: m_skipBehavior = SkipBehavior.BasicBehavior; break; } }
string GetSkipReason(SkipBehavior skipBehavior, Case @case) { try { return skipBehavior.GetSkipReason(@case); } catch (Exception exception) { throw new Exception( "Exception thrown while attempting to get a custom case-skipped reason. " + "Check the inner exception for more details.", exception); } }
bool SkipCase(SkipBehavior skipBehavior, Case @case) { try { return skipBehavior.SkipCase(@case); } catch (Exception exception) { throw new Exception( "Exception thrown while attempting to run a custom case-skipping predicate. " + "Check the inner exception for more details.", exception); } }
/// <summary> /// Allows the specified predicate to determine whether a given test case should be skipped /// during execution. Skipped test cases are never executed, but are counted and identified. /// When a test is skipped, the behavior may include an optional explanation in the output. /// </summary> public CaseBehaviorExpression Skip(SkipBehavior behavior) { return(Skip(behavior.SkipCase, behavior.GetSkipReason)); }
public void AddSkipBehavior(SkipBehavior skipBehavior) { skipBehaviors.Add(skipBehavior); }