Exemple #1
0
        public IList <UnitTestTask> GetTaskSequence(IList <IUnitTestElement> explicitElements)
#endif
        {
            if (this is ContextSpecificationElement)
            {
                var contextSpecification = this as ContextSpecificationElement;
                var context = contextSpecification.Context;

                return(new List <UnitTestTask>
                {
#if !RESHARPER_8
                    _taskFactory.CreateAssemblyLoadTask(context),
#endif
                    _taskFactory.CreateRunAssemblyTask(context),
                    _taskFactory.CreateContextTask(context),
                    _taskFactory.CreateContextSpecificationTask(context, contextSpecification)
                });
            }

            if (this is BehaviorSpecificationElement)
            {
                var behaviorSpecification = this as BehaviorSpecificationElement;
                var behavior = behaviorSpecification.Behavior;
                var context  = behavior.Context;

                return(new List <UnitTestTask>
                {
#if !RESHARPER_8
                    _taskFactory.CreateAssemblyLoadTask(context),
#endif
                    _taskFactory.CreateRunAssemblyTask(context),
                    _taskFactory.CreateContextTask(context),
                    _taskFactory.CreateBehaviorSpecificationTask(context, behaviorSpecification)
                });
            }

            if (this is ContextElement || this is BehaviorElement)
            {
                return(EmptyArray <UnitTestTask> .Instance);
            }

            throw new ArgumentException(String.Format("Element is not a Machine.Specifications element: '{0}'", this));
        }