Ejemplo n.º 1
0
        public void ShouldNotBePossibleToAddNULL()
        {
            //Given
            StoryRunner storyRunner = new StoryRunner(null);

            //When
            storyRunner.AddStory <object>(null);
        }
        public void ShouldNotBePossibleToAddNULL()
        {
            //Given
            StoryRunner storyRunner = new StoryRunner(null);

            //When
            storyRunner.AddStory<object>(null);
        }
        public void SHouldNotBePossibleToAddStringAsStory()
        {
            //Given
            StoryRunner storyRunner = new StoryRunner(Assembly.GetAssembly(this.GetType()));

            string story = "Ths is not a story";
            //When
            storyRunner.AddStory(story);

            //Then
            // we get an exception
        }
Ejemplo n.º 4
0
        void Start()
        {
            StoryContext context = new StoryContext();

            context.StoryEntry = this;
            StoryRunner runner = new StoryRunner();

            context.StoryPlayer = runner;

            installer.Install(context);
            context.Resolve();
            runner.Run(installer.GetScenarioName());
        }
Ejemplo n.º 5
0
        public void SHouldNotBePossibleToAddStringAsStory()
        {
            //Given
            StoryRunner storyRunner = new StoryRunner(Assembly.GetAssembly(this.GetType()));

            string story = "Ths is not a story";

            //When
            storyRunner.AddStory(story);

            //Then
            // we get an exception
        }
        public void ShouldRunStory()
        {
            //Given
            FakeStory story = new FakeStory();

            StoryRunner storyRunner = new StoryRunner();
            storyRunner.AddStory(story);
            //When
            storyRunner.Run();

            //Then
            Assert.IsTrue(story.didCallRun);
        }
Ejemplo n.º 7
0
        public void ShouldRunStory()
        {
            //Given
            FakeStory story = new FakeStory();

            StoryRunner storyRunner = new StoryRunner();

            storyRunner.AddStory(story);
            //When
            storyRunner.Run();

            //Then
            Assert.IsTrue(story.didCallRun);
        }
Ejemplo n.º 8
0
        public void ShouldFindStoryInAssembly()
        {
            // Since I'm lazy, I will use Examlpes.CS

            //Given
            System.Reflection.Assembly asm = this.GetType().Assembly;

            StoryRunner storyRunner = new StoryRunner(asm);
            bool        storyCalled = false;

            storyRunner.ExecutingStory += delegate(Object sender, StoryEventArgs e) { storyCalled = true; };

            //When
            storyRunner.Run();

            //Then - Check on how many stories that where executed instead, via the events.
            Assert.IsTrue(storyCalled);
        }
        public void ShouldFindStoryInAssembly()
        {
            // Since I'm lazy, I will use Examlpes.CS

            //Given
            System.Reflection.Assembly asm = this.GetType().Assembly;

            StoryRunner storyRunner = new StoryRunner(asm);
            bool storyCalled = false;

            storyRunner.ExecutingStory += delegate(Object sender, StoryEventArgs e) { storyCalled = true; };

            //When
            storyRunner.Run();

            //Then - Check on how many stories that where executed instead, via the events.
            Assert.IsTrue(storyCalled);
        }
Ejemplo n.º 10
0
 void Start()
 {
     _runner = GetComponent <StoryRunner>();
 }