Beispiel #1
0
        public IEnumerable <Story> GetStories()
        {
            Story story;
            var   stories = new List <Story>();

            foreach (var storyInfo in _reader.GetStoryInfos())
            {
                if (null == (story = _parser.Parse(storyInfo.Text, storyInfo.Location)))
                {
                    continue;
                }

                story.Id = Path.GetFileName(storyInfo.Location);
                stories.Add(story);
            }
            return(stories);
        }
        public Scenario GetScenario(string name)
        {
            if (scenarios.ContainsKey(name))
            {
                return(scenarios[name]);
            }

            if (rawScenarioScripts.ContainsKey(name))
            {
                var scenario = new Scenario(parser.Parse(rawScenarioScripts[name]));
                scenario.name = name;
                scenarios.Add(name, scenario);
                return(scenario);
            }

            throw new Exception(string.Format("Scenario Scripts Not Found : {0} ", name));
        }