public static void MoveToState(IPreconditions condition, NUnit.Framework.DescriptionAttribute method) { try { var temp = alwaysMoveToCondition; alwaysMoveToCondition = true; IsInState(condition, method); alwaysMoveToCondition = temp; } catch (Exception ex) { throw new ArgumentException(String.Format("Can't reach state: %s. Reason: %s", condition, ex.Message)); } }
public static void isInState(IPreconditions condition, MethodBase method) { try { System.Diagnostics.Debug.WriteLine(string.Format("=== Start precondition. Thread id : %s", Thread.CurrentThread.ManagedThreadId)); JDISettings.logger.info("Move to condition: " + condition); if (method != null) JDIData.testName = method.Name; if (!alwaysMoveToCondition && condition.checkAction()) return; condition.moveToAction(); System.Diagnostics.Debug.WriteLine(string.Format("=== Move to done precondition. Thread id : %s", Thread.CurrentThread.ManagedThreadId)); JDISettings.asserter.isTrue(condition.checkAction); JDISettings.logger.info(condition + " condition achieved"); } catch (Exception ex) { throw JDISettings.asserter.exception(string.Format("Can't reach state: %s. Reason: %s", condition, ex.Message)); } }
public static void IsInState(IPreconditions condition, NUnit.Framework.DescriptionAttribute method) { try { new Log4Net().Info("Move to condition: " + condition); if (method != null) { JDIData.testName = method.GetType().FullName; } if (!alwaysMoveToCondition && condition.CheckAction()) { return; } condition.MoveToAction(); NUnit.Framework.Assert.IsTrue(condition.CheckAction()); new Log4Net().Info(condition + " condition achieved"); } catch (Exception ex) { throw new ArgumentException(String.Format("Can't reach state: %s. Reason: %s", condition, ex.Message)); } }
public static void isInState(IPreconditions condition, MethodBase method) { try { System.Diagnostics.Debug.WriteLine(string.Format("=== Start precondition. Thread id : %s", Thread.CurrentThread.ManagedThreadId)); JDISettings.logger.info("Move to condition: " + condition); if (method != null) { JDIData.testName = method.Name; } if (!alwaysMoveToCondition && condition.checkAction()) { return; } condition.moveToAction(); System.Diagnostics.Debug.WriteLine(string.Format("=== Move to done precondition. Thread id : %s", Thread.CurrentThread.ManagedThreadId)); JDISettings.asserter.isTrue(condition.checkAction); JDISettings.logger.info(condition + " condition achieved"); } catch (Exception ex) { throw JDISettings.asserter.exception(string.Format("Can't reach state: %s. Reason: %s", condition, ex.Message)); } }
public void IsInState(IPreconditions precondition, NUnit.Framework.DescriptionAttribute method) { JDISettings.DriverFactory.CurrentDriverName = driverName; PreconditionsState.IsInState(precondition, method); }
public void IsInState(IPreconditions precondition) { JDISettings.DriverFactory.CurrentDriverName = driverName; PreconditionsState.IsInState(precondition); }
public bool EvaluatePreconditions(IPreconditions preconditions) { return(true); // TODO: implement precondition checks }
public static void MoveToState(IPreconditions condition) { MoveToState(condition, null); }
public static void IsInState(IPreconditions condition) { IsInState(condition, null); }