public static StoryTestSource FromFile(StoryPageName name, string content) { if (name.IsExcelSpreadsheet) { return(new ExcelStoryTestSource(name.Name)); } return(FromString(content)); }
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); } }
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); } }
private void ReportPageName(StoryPageName pageName, StoryTestString input, Action<StoryTestString, TestCounts> handleResults, Action handleNoTest) { myReporter.WriteLine(pageName.Name); }