Beispiel #1
0
 public FailResult(CaseExecution execution)
 {
     Case = execution.Case;
     Output = execution.Output;
     Duration = execution.Duration;
     Exceptions = execution.Exceptions;
 }
Beispiel #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();
        }
Beispiel #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);
        }
Beispiel #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);
        }
 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);
     }
 }
 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);
     }
 }
        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();
        }
Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
Beispiel #11
0
 public PassResult(CaseExecution execution)
 {
     Case = execution.Case;
     Output = execution.Output;
     Duration = execution.Duration;
 }
Beispiel #12
0
 public PassResult(CaseExecution execution)
 {
     Case     = execution.Case;
     Output   = execution.Output;
     Duration = execution.Duration;
 }
Beispiel #13
0
 public void Execute(CaseExecution caseExecution, object instance)
 {
     caseBehavior.Execute(caseExecution, instance);
 }
Beispiel #14
0
 public ClassExecution(ExecutionPlan executionPlan, Type testClass, CaseExecution[] caseExecutions)
 {
     ExecutionPlan = executionPlan;
     TestClass = testClass;
     CaseExecutions = caseExecutions;
 }