public override void Execute(Speed speed) { //no delay for speed on showing a form. try { Type formType = Type.GetType(Control.Trim()); if(formType == null) { foreach(Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { formType = assembly.GetType(Control.Trim()); if(formType != null) { break; } formType = assembly.GetType(Control.Substring(0, Control.IndexOf(","))); if(formType != null) { break; } } } Form formInstance = (Form) Activator.CreateInstance(formType); formInstance.Show(); } catch { throw new FormsTestAssertionException("Form display failed. Be sure to load the form assembly first."); } }
public override void Execute(Speed speed) { SlowDownAndPaint(speed); ControlTester tester = GetTester(); try { MethodInfo methodInfo = tester.GetType().GetMethod(Action, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); methodInfo.Invoke(tester, new object[] {Args}); } catch(Exception e) { throw new FormsTestAssertionException( string.Format("Line Number {0} : {1} : {2}", LineNumber, e.Message, e.StackTrace)); } SlowDownAndPaint(speed); }
protected void SlowDownAndPaint(Speed speed) { if(speed.Value < 100 && !speed.StepMode) { PaintAllForms(); } speed.Delay(); }
public abstract void Execute(Speed speed);