public void SetupContext()
 {
     var mapper = new StoryContextFactory();
     mapper.AddContext<TestMappingContext>();
     StoryContext = mapper.GetContextForStory(new Story("", "", new IScenario[] {}));
 }
        public void Should_Register_Assembly_Types()
        {
            var mapper = new StoryContextFactory();
            mapper.AddAssembly(GetType().Assembly);

            var context = mapper.GetContextForStory(new Story("context test", "context test", new List<IScenario>()));
            context.ImplementingTypes.ShouldContain(typeof (TestMappingContext));
        }
        public void Throws_if_no_context_added()
        {
            var mapper = new StoryContextFactory();

            Expect.ThisToThrow<ConfigurationException>(() => mapper.GetContextForStory(new Story("unknown type",
                                                                                                 "totally bogus",
                                                                                                 new List<IScenario>())));
        }
        public void Should_Map_By_ContextAttribute()
        {
            var story = new Story("context test", "context test", new List<IScenario>());

            var mapper = new StoryContextFactory();
            mapper.AddContext<TestMappingContext>();

            var context = mapper.GetContextForStory(story);
            context.ImplementingTypes.First().ShouldEqual(typeof (TestMappingContext));
        }