/// <summary> /// [Call from external environment] Runs with cycle with open-action-close context. /// </summary> /// <param name="context">Context</param> /// <param name="action">Acton to run</param> /// <param name="endCondition">End condition. When `true` cycle stops.</param> public static void Run(this ITestContext context, Action action, Func <bool> endCondition) { while (!endCondition()) { context.ContextOpen(); action(); context.ContextClose(); } }
/// <summary> /// [Call from external environment] Runs with cycle with open-action-close context. /// </summary> /// <param name="context">Context</param> /// <param name="action">Action to run, when returns `true` cycle stops.</param> public static void Run(this ITestContext context, Func <bool> action) { bool actionDone = false; while (!actionDone) { context.ContextOpen(); actionDone = action(); context.ContextClose(); } }
/// <summary> /// [Call from external environment] Runs the remote action once. /// </summary> /// <param name="context">Context</param> /// <param name="action">Action to run.</param> public static void Run(this ITestContext context, Action action) { context.ContextOpen(); action(); context.ContextClose(); }