コード例 #1
0
ファイル: RunInput.cs プロジェクト: jiristeidl/Storyteller
        public BatchRunRequest GetBatchRunRequest()
        {
            var tagsString = ExcludeTagsFlag ?? "";
            var top        = HierarchyLoader.ReadHierarchy(SpecPath);
            var tags       = tagsString.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToArray();
            var specs      = HierarchyLoader.Filter(top, LifecycleFlag, WorkspaceFlag, tags).ToList();

            return(new BatchRunRequest(specs));
        }
コード例 #2
0
        public void filter_by_including_multiple_tags()
        {
            var specs = HierarchyLoader.Filter(theHierarchy, Lifecycle.Any, includeTags: new string[] { "check", "do" })
                        .Select(x => x.path).ToArray();

            specs.Length.ShouldBe(5);

            specs.ShouldContain("General/Check properties");
            specs.ShouldContain("General/Occasionally Times Out");
        }
コード例 #3
0
        public void filter_by_excluding_tags()
        {
            var paths = HierarchyLoader.Filter(theHierarchy, Lifecycle.Any, excludeTags: new string[] { "check" })
                        .Select(x => x.path).ToArray();


            paths.ShouldNotContain("General/Check properties");
            paths.ShouldNotContain("Paragraphs/Composite with Errors");
            paths.ShouldNotContain("Sentences/Currying");
        }
コード例 #4
0
ファイル: RunInput.cs プロジェクト: tdawgy/Storyteller
        public Task <List <Specification> > ReadSpecs()
        {
            return(Task.Factory.StartNew(() =>
            {
                ConsoleWriter.Write(ConsoleColor.Cyan, "Reading specifications from " + SpecPath);

                var top = HierarchyLoader.ReadHierarchy(SpecPath);
                // TODO -- filter on tags here
                // TODO -- make HierarchyLoader smart enough to recognize spec or suite
                return HierarchyLoader.Filter(top, LifecycleFlag, SpecificationOrSuite, new string[0]).ToList();
            }));
        }
コード例 #5
0
        //[Fact]
        public void write_initial_model()
        {
            // You need to compile everything before trying to use this
            var input = new ProjectInput(EngineMode.Batch)
            {
                Path =
                    samplesFolder,
                ProfileFlag = "Safari"
            };

            using (var controller = input.BuildEngine())
            {
                controller.Start().Wait(30.Seconds());

                var hierarchy = HierarchyLoader.ReadHierarchy(input.Path.AppendPath("Specs"));
                var specs     = HierarchyLoader.Filter(hierarchy);

                var request = new BatchRunRequest(specs);

                var response = controller.Send(request).AndWaitFor <BatchRunResponse>();


                var cache = new ResultsCache();
                response.Result.records.Each(
                    x =>
                {
                    var completed = new SpecExecutionCompleted(x.specification.id, x.results, x.specification);
                    cache.Store(completed);
                });

                response.Result.fixtures = controller.LatestSystemRecycled.fixtures;


                var hierarchyLoaded = new HierarchyLoaded(hierarchy, cache);

                writeResponse(response.Result);
                //writeInitialization(initialization);
            }
        }
コード例 #6
0
 public void throw_when_filtering_by_suite_that_does_not_exist()
 {
     Should.Throw <SuiteNotFoundException>(() => HierarchyLoader.Filter(theTopSuite, suiteName: "Doesn't Exist"));
 }
コード例 #7
0
 public void filter_top_by_lifecycle()
 {
     HierarchyLoader.Filter(theTopSuite, lifecycle: Lifecycle.Regression).ShouldHaveTheSameElementsAs(childSuite1.Specifications[1], childSuite2.Specifications[1]);
 }
コード例 #8
0
 public void filter_by_suite_and_lifecycle()
 {
     HierarchyLoader.Filter(theTopSuite, lifecycle: Lifecycle.Acceptance, suiteName: childSuite1.name).ShouldHaveTheSameElementsAs(childSuite1.Specifications[0]);
 }
コード例 #9
0
 public void filter_by_suite()
 {
     HierarchyLoader.Filter(theTopSuite, suiteName: childSuite1.name).ShouldHaveTheSameElementsAs(childSuite1.Specifications);
 }
コード例 #10
0
 public void filter_by_single_excluded_tag()
 {
     HierarchyLoader.Filter(theTopSuite, tags: new[] { "tag1" }).ShouldHaveTheSameElementsAs(childSuite1.Specifications[1], childSuite2.Specifications[1]);
 }
コード例 #11
0
 public void default_filter_returns_all_specs()
 {
     HierarchyLoader.Filter(theTopSuite).ShouldHaveTheSameElementsAs(theTopSuite.GetAllSpecs().ToArray());
 }
コード例 #12
0
 public void filter_by_multiple_excluded_tags()
 {
     HierarchyLoader.Filter(theTopSuite, excludeTags: new[] { "tag1", "tag2" }).ShouldHaveTheSameElementsAs(childSuite2.Specifications[1]);
 }
コード例 #13
0
 public void filter_by_including_tags()
 {
     HierarchyLoader.Filter(theHierarchy, Lifecycle.Any, includeTags: new string[] { "check" })
     .Select(x => x.path)
     .ShouldHaveTheSameElementsAs("General/Check properties", "Paragraphs/Composite with Errors", "Sentences/Currying");
 }
コード例 #14
0
 public void filter_by_spec_path_with_spaces()
 {
     HierarchyLoader.Filter(theHierarchy, Lifecycle.Any, "Embedded / Embeds")
     .Single().path.ShouldBe("Embedded/Embeds");
 }
コード例 #15
0
 public void filter_by_found_suite()
 {
     HierarchyLoader.Filter(theHierarchy, Lifecycle.Any, "Embedded")
     .Single().path.ShouldBe("Embedded/Embeds");
 }