public void ShouldRunStoryAndGetStuffInStream()
        {
            //Given
            string expectToStartWith = "Story: Fake story";
            string expectToContain = "--> Passed" + Environment.NewLine;

            FakeStory story = new FakeStory();

            System.Collections.ArrayList stories = new System.Collections.ArrayList();
            stories.Add(story);
            Stream sr = new MemoryStream();
            StreamRunner storyRunner = new FullTextRunner(sr, System.Reflection.Assembly.GetAssembly(this.GetType()));

            //When
            storyRunner.Run();

            //Then
            sr.Seek(0, 0);
            TextReader s = new StreamReader(sr);
            string result = s.ReadToEnd();
            Assert.IsTrue(result.StartsWith(expectToStartWith));
            Assert.IsTrue(result.Contains(expectToContain));
        }
Exemple #2
0
        public void ShouldRunStoryAndGetStuffInStream()
        {
            //Given
            string expectToStartWith = "Story: Fake story";
            string expectToContain   = "--> Passed" + Environment.NewLine;

            FakeStory story = new FakeStory();

            System.Collections.ArrayList stories = new System.Collections.ArrayList();
            stories.Add(story);
            Stream       sr          = new MemoryStream();
            StreamRunner storyRunner = new FullTextRunner(sr, System.Reflection.Assembly.GetAssembly(this.GetType()));

            //When
            storyRunner.Run();

            //Then
            sr.Seek(0, 0);
            TextReader s      = new StreamReader(sr);
            string     result = s.ReadToEnd();

            Assert.IsTrue(result.StartsWith(expectToStartWith));
            Assert.IsTrue(result.Contains(expectToContain));
        }