Esempio n. 1
0
 public void OrderedTests(TestDataSource_UserStory_Two data)
 {
     try
     {
         foreach (string methodName in data.OrderList.OrderBy(name => name))
         {
             // NO usar Polly aca, porque solo lleguan TargetInvocationException
             System.Reflection.MethodInfo method = GetType().GetMethod(methodName);
             method.Invoke(this, new object[] { "PrimerParametro", true });
         }
     }
     catch (TargetInvocationException tiEx)
     {
         if (tiEx is TargetInvocationException)
         {
             if (tiEx?.InnerException is AssertFailedException)
             {
                 Debug.WriteLine(tiEx.InnerException.Message);
                 throw tiEx.InnerException;
             }
         }
         // Si falla el metodo se corta, se arroja la inner Exception
         // Se usa el metodo ManageException
         throw;
     }
     catch (Exception ex)
     {
         //  se arroja una excepcion personalizada
         // Se usa el metodo ManageException
         throw new OrderListExecutionException(ex.Message);
     }
 }
Esempio n. 2
0
        public static IEnumerable <TestDataSource_UserStory_Two[]> OrderListDataSource()
        {
            TestDataSource_UserStory_Two testListDataSource = new TestDataSource_UserStory_Two()
            {
                OrderList = new List <string>()
                {
                    "Method_01",
                    "Method_02",
                    "Method_03",
                }
            };

            return(new[] {
                new TestDataSource_UserStory_Two[] { testListDataSource }
            });
            //yield return new TestRetenciones[] { testRetencionesParams };
            //yield return new TestRetenciones[] { testRetencionesParams2 };
        }