Ejemplo n.º 1
0
 private void Execute(IDataUse globalData, IDataUse testData, Type t, string pid, string tcid)
 {
     try
     {
         //Binding properties that test script used
         var obj = t.InvokeMember(null, BindingFlags.CreateInstance, null, null, null);
         t.InvokeMember(ETestUsage.TestData.ToString(), BindingFlags.SetProperty, null, obj, new object[] { testData });
         t.InvokeMember(ETestUsage.GlobalData.ToString(), BindingFlags.SetProperty, null, obj, new object[] { globalData });
         t.InvokeMember(ETestUsage.Reporter.ToString(), BindingFlags.SetProperty, null, obj, new object[] { _reporter });
         t.InvokeMember(ETestUsage.PID.ToString(), BindingFlags.SetProperty, null, obj, new object[] { pid });
         t.InvokeMember(ETestUsage.TCID.ToString(), BindingFlags.SetProperty, null, obj, new object[] { tcid });
         InvokeSteps(t, obj);
     }
     catch (Exception e)
     {
         ConsoleLogger.LogError("Error occured in class {0},{1}", t.Name, e);
         throw e;
     }
 }
Ejemplo n.º 2
0
 private void Execute(IDataUse globalData, IDataUse testData, Type t, string pid, string tcid)
 {
     try
     {
         //Binding properties that test script used
         var obj = t.InvokeMember(null, BindingFlags.CreateInstance, null, null, null);
         t.InvokeMember(ETestUsage.TestData.ToString(), BindingFlags.SetProperty, null, obj, new object[] { testData });
         t.InvokeMember(ETestUsage.GlobalData.ToString(), BindingFlags.SetProperty, null, obj, new object[] { globalData });
         t.InvokeMember(ETestUsage.Reporter.ToString(), BindingFlags.SetProperty, null, obj, new object[] { _reporter });
         t.InvokeMember(ETestUsage.PID.ToString(), BindingFlags.SetProperty, null, obj, new object[] { pid });
         t.InvokeMember(ETestUsage.TCID.ToString(), BindingFlags.SetProperty, null, obj, new object[] { tcid });
         InvokeSteps(t, obj);
     }
     catch (Exception e)
     {
         ConsoleLogger.LogError("Error occured in class {0},{1}", t.Name, e);
         throw e;
     }
 }