示例#1
0
        public IEnumerable<Specification> Filter(Suite top)
        {
            if (Lifecycle == Lifecycle.Any && Suite.IsEmpty()) return top.GetAllSpecs();

            IEnumerable<Specification> specs;

            if (Suite.IsNotEmpty())
            {
                var suite = top.suites.FirstOrDefault(x => x.name == Suite);
                if (suite == null)
                    throw new SuiteNotFoundException(Suite, top);

                specs = suite.GetAllSpecs();
            }
            else
            {
                specs = top.GetAllSpecs();
            }

            if (Lifecycle != Lifecycle.Any)
            {
                specs = specs.Where(x => x.Lifecycle == Lifecycle);
            }

            return specs.ToArray();
        }
示例#2
0
        public IEnumerable <Specification> Filter(Suite top)
        {
            IEnumerable <Specification> specs;

            if (Suite.IsNotEmpty())
            {
                var suite = top.suites.FirstOrDefault(x => x.name == Suite);
                if (suite == null)
                {
                    throw new SuiteNotFoundException(Suite, top);
                }

                specs = suite.GetAllSpecs();
            }
            else
            {
                specs = top.GetAllSpecs();
            }

            if (Lifecycle != Lifecycle.Any)
            {
                specs = specs.Where(x => x.Lifecycle == Lifecycle);
            }

            var tags = Tags ?? new string[0];

            if (tags.Any())
            {
                specs = specs.Where(spec => tags.All(tag => !spec.Tags.Contains(tag)));
            }

            return(specs.ToArray());
        }
 public integration_tests_with_the_grammar_project()
 {
     _hierarchy = HierarchyLoader.ReadHierarchy(_folder);
     _allSpecs  = _hierarchy.GetAllSpecs().ToArray();
 }
 public void default_filter_returns_all_specs()
 {
     theFilteredSpecs.ShouldHaveTheSameElementsAs(theTopSuite.GetAllSpecs().ToArray());
 }
        public HierarchyLoaded(Suite top, ResultsCache results) : base("hierarchy-loaded")
        {
            hierarchy = top;

            specs = top.GetAllSpecs().Select(x => new SpecRecord(x, results)).ToArray();
        }
 public void default_filter_returns_all_specs()
 {
     HierarchyLoader.Filter(theTopSuite).ShouldHaveTheSameElementsAs(theTopSuite.GetAllSpecs().ToArray());
 }
示例#7
0
 public void SetUp()
 {
     _hierarchy = HierarchyLoader.ReadHierarchy(_folder);
     _allSpecs  = _hierarchy.GetAllSpecs().ToArray();
 }