private StoryMetadata CreateSpecificationMetadata(IScenario specification) { var sutType = specification.SutType(); var title = sutType.Name; var story = specification.Story.Create<Story>(); var storyAttribute = new StoryAttribute() { Title = title, TitlePrefix = story.TitlePrefix }; return new StoryMetadata(sutType, storyAttribute); }
private StoryMetadata CreateSpecificationMetadata(IScenario specification) { var story = (Story)Activator.CreateInstance(specification.Story); var storyAttribute = new StoryAttribute() { Title = specification.Title, TitlePrefix = story.TitlePrefix }; return(new StoryMetadata(specification.Story, storyAttribute)); }
public virtual StoryMetadata Scan(object testObject, Type explicityStoryType = null) { var specification = testObject as ISpecification; if (specification == null) return null; string specificationTitle = CreateSpecificationTitle(specification); var story = new StoryAttribute() {Title = specificationTitle}; return new StoryMetadata(specification.Story, story); }
private StoryMetadata CreateSpecificationMetadata(IScenario specification) { var title = specification.GetType().GetProperty("SUT").PropertyType.Name; var story = specification.Story.Create <Story>(); var storyAttribute = new StoryAttribute() { Title = title, TitlePrefix = story.TitlePrefix }; return(new StoryMetadata(specification.Story, storyAttribute)); }
// creates display for unit test reports private static StoryMetadata CreateSpecificationMetadata(IScenario specification) { var sutType = specification.SutType(); // scenario title on report is name of SUT class unless story title is overridden in var title = specification.Story.Title ?? sutType.Name; var story = specification.Story; var storyAttribute = new StoryAttribute { Title = title, TitlePrefix = story.TitlePrefix }; return(new StoryMetadata(sutType, storyAttribute)); }