Exemplo n.º 1
0
 public static StoryTestSource FromFile(StoryPageName name, string content)
 {
     if (name.IsExcelSpreadsheet)
     {
         return(new ExcelStoryTestSource(name.Name));
     }
     return(FromString(content));
 }
Exemplo n.º 2
0
        private void ExecutePage(StoryPageName pageName, StoryTestString input, Action<StoryTestString, TestCounts> handleResults,
	                             Action handleNoTest)
        {
            var service = new Service.Service(configuration);
            Tree<Cell> result = service.Compose(input);
            if (result == null) {
                handleNoTest();
                return;
            }
            var storyTest = new StoryTest((Parse) result.Value,
                                          (tables, counts) =>
                                          handleResults(service.ParseTree<Cell, StoryTestString>(tables), counts));
            if (pageName.IsSuitePage) {
                storyTest.ExecuteOnConfiguration(configuration);
            }
            else {
                storyTest.Execute(configuration);
            }
        }
Exemplo n.º 3
0
        private void ExecutePage(StoryPageName pageName, StoryTestString input, Action <StoryTestString, TestCounts> handleResults,
                                 Action handleNoTest)
        {
            var         service = new Service.Service(configuration);
            Tree <Cell> result  = service.Compose(input);

            if (result == null || result.Branches.Count == 0)
            {
                handleNoTest();
                return;
            }
            var storyTest = new StoryTest((Parse)result,
                                          (tables, counts) =>
                                          handleResults(service.ParseTree <Cell, StoryTestString>(tables), counts));

            if (pageName.IsSuitePage)
            {
                storyTest.ExecuteOnConfiguration(configuration);
            }
            else
            {
                storyTest.Execute(configuration);
            }
        }
Exemplo n.º 4
0
        private void ReportPageName(StoryPageName pageName, StoryTestString input, Action<StoryTestString, TestCounts> handleResults,
	                             Action handleNoTest)
        {
            myReporter.WriteLine(pageName.Name);
        }