Exemplo n.º 1
0
 public FailResult(CaseExecution execution)
 {
     Case = execution.Case;
     Output = execution.Output;
     Duration = execution.Duration;
     Exceptions = execution.Exceptions;
 }
Exemplo n.º 2
0
 public Fixture(Type testClass, object instance, CaseBehavior caseExecutionBehavior, CaseExecution[] caseExecutions)
 {
     TestClass = testClass;
     Instance = instance;
     CaseExecutionBehavior = caseExecutionBehavior;
     CaseExecutions = caseExecutions;
 }
        private void CommitBeforeTestCase(CaseExecution caseexecution, object instance, Action innerbehavior)
        {
            var session = _container.GetInstance<ISession>();
            session.Flush();
            session.Clear();

            innerbehavior();
        }
Exemplo n.º 4
0
        public FailResult(CaseExecution execution, AssertionLibraryFilter filter)
        {
            Case = execution.Case;
            Output = execution.Output;
            Duration = execution.Duration;
            Exceptions = execution.Exceptions;

            ExceptionSummary = new ExceptionInfo(Exceptions, filter);
        }
Exemplo n.º 5
0
        public FailResult(CaseExecution execution, AssertionLibraryFilter filter)
        {
            Case       = execution.Case;
            Output     = execution.Output;
            Duration   = execution.Duration;
            Exceptions = execution.Exceptions;

            ExceptionSummary = new ExceptionInfo(Exceptions, filter);
        }
Exemplo n.º 6
0
 public override void Execute(object instance, CaseExecution caseExecution)
 {
     try
     {
         throw new ArgumentException("This parameterized test could not be executed, because no input values were available.");
     }
     catch (Exception exception)
     {
         caseExecution.Fail(exception);
     }
 }
Exemplo n.º 7
0
 public override void Execute(object instance, CaseExecution caseExecution)
 {
     try
     {
         throw new ArgumentException("This parameterized test could not be executed, because no input values were available.");
     }
     catch (Exception exception)
     {
         caseExecution.Fail(exception);
     }
 }
Exemplo n.º 8
0
        private void TestCaseWrapper(CaseExecution caseExecution, object instance, Action innerbehavior)
        {
            var attr = caseExecution.Case.Method.GetCustomAttribute<FeatureAttribute>(true);

            if (attr != null)
            {
                var writer = GetWriter(attr.ReferenceAssembly);
                writer.Write(caseExecution.Case);
            }

            innerbehavior();
        }
Exemplo n.º 9
0
        public virtual void Execute(object instance, CaseExecution caseExecution)
        {
            try
            {
                bool isDeclaredAsync = Method.IsAsync();

                if (isDeclaredAsync && Method.IsVoid())
                {
                    ThrowForUnsupportedAsyncVoid();
                }

                object result;
                try
                {
                    result = Method.Invoke(instance, parameters);
                }
                catch (TargetInvocationException exception)
                {
                    throw new PreservedException(exception.InnerException);
                }

                if (isDeclaredAsync)
                {
                    var task = (Task)result;
                    try
                    {
                        task.Wait();
                    }
                    catch (AggregateException exception)
                    {
                        throw new PreservedException(exception.InnerExceptions.First());
                    }
                }
            }
            catch (Exception exception)
            {
                caseExecution.Fail(exception);
            }
        }
Exemplo n.º 10
0
        public virtual void Execute(object instance, CaseExecution caseExecution)
        {
            try
            {
                bool isDeclaredAsync = Method.IsAsync();

                if (isDeclaredAsync && Method.IsVoid())
                    ThrowForUnsupportedAsyncVoid();

                object result;
                try
                {
                    result = Method.Invoke(instance, parameters);
                }
                catch (TargetInvocationException exception)
                {
                    throw new PreservedException(exception.InnerException);
                }

                if (isDeclaredAsync)
                {
                    var task = (Task)result;
                    try
                    {
                        task.Wait();
                    }
                    catch (AggregateException exception)
                    {
                        throw new PreservedException(exception.InnerExceptions.First());
                    }
                }
            }
            catch (Exception exception)
            {
                caseExecution.Fail(exception);
            }
        }
Exemplo n.º 11
0
 public PassResult(CaseExecution execution)
 {
     Case = execution.Case;
     Output = execution.Output;
     Duration = execution.Duration;
 }
Exemplo n.º 12
0
 public PassResult(CaseExecution execution)
 {
     Case     = execution.Case;
     Output   = execution.Output;
     Duration = execution.Duration;
 }
Exemplo n.º 13
0
 public void Execute(CaseExecution caseExecution, object instance)
 {
     caseBehavior.Execute(caseExecution, instance);
 }
Exemplo n.º 14
0
 public ClassExecution(ExecutionPlan executionPlan, Type testClass, CaseExecution[] caseExecutions)
 {
     ExecutionPlan = executionPlan;
     TestClass = testClass;
     CaseExecutions = caseExecutions;
 }