Ejemplo n.º 1
0
        public Story CreateOneStoryWithOneFailingScenarioAndOnePassingScenarioWithThreeStepsOfFiveMillisecondsAndEachHasTwoExamples()
        {
            var storyMetadata = new StoryMetadata(typeof(RegularAccountHolderStory), "As a person", "I want ice cream", "So that I can be happy", "Happiness");
            var story = new Story(storyMetadata, GetScenarios(true, true));

            return story;
        }
Ejemplo n.º 2
0
        public Story(StoryMetadata metadata, params Scenario[] scenarios)
        {
            Metadata = metadata;
            Scenarios = scenarios;

            if (scenarios.Length > 0)
            {
                var testObject = scenarios.First().TestObject;
                if(testObject != null)
                    Namespace = testObject.GetType().Namespace;
            }
        }
Ejemplo n.º 3
0
        public IEnumerable<Story> CreateTwoStoriesEachWithOneFailingScenarioAndOnePassingScenarioWithThreeStepsOfFiveMillisecondsAndEachHasTwoExamples()
        {
            var storyMetadata1 = new StoryMetadata(typeof(RegularAccountHolderStory), "As a person", "I want ice cream", "So that I can be happy", "Happiness");
            var storyMetadata2 = new StoryMetadata(typeof(GoldAccountHolderStory), "As an account holder", "I want to withdraw cash", "So that I can get money when the bank is closed", "Account holder withdraws cash");
            var stories = new List<Story>
            {
                new Story(storyMetadata1, GetScenarios(false, true)),
                new Story(storyMetadata2, GetScenarios(true, true))
            };

            return stories;
        }
Ejemplo n.º 4
0
        public IEnumerable<Story> CreateMixContainingEachTypeOfOutcome()
        {
            var storyMetadata1 = new StoryMetadata(typeof(RegularAccountHolderStory), "As a person", "I want ice cream", "So that I can be happy", "Happiness");
            var storyMetadata2 = new StoryMetadata(typeof(GoldAccountHolderStory), "As an account holder", "I want to withdraw cash", "So that I can get money when the bank is closed", "Account holder withdraws cash");

            const StoryMetadata testThatReportWorksWithNoStory = null;

            var stories = new List<Story>
            {
                new Story(storyMetadata1, GetOneOfEachScenarioResult()),
                new Story(storyMetadata2, GetOneOfEachScenarioResult()),
                new Story(testThatReportWorksWithNoStory, GetOneOfEachScenarioResult())
            };

            return stories;
        }
Ejemplo n.º 5
0
        public IEnumerable<Story> CreateMixContainingEachTypeOfOutcomeWithOneScenarioPerStory()
        {
            var storyMetadata1 = new StoryMetadata(typeof(RegularAccountHolderStory), "As a person", "I want ice cream", "So that I can be happy", "Happiness");
            var storyMetadata2 = new StoryMetadata(typeof(GoldAccountHolderStory), "As an unhappy examples story", "I want to see failed steps", "So that I can diagnose what's wrong", "Unhappy examples");
            var storyMetadata3 = new StoryMetadata(typeof(PlatinumAccountHolderStory), "As a happy examples story", "I want a clean report with examples", "So that the report is clean and readable", "Happy Examples");

            const StoryMetadata testThatReportWorksWithNoStory = null;

            var stories = new List<Story>
            {
                new Story(storyMetadata1, new Scenario(typeof(HappyPathScenario), GetHappyExecutionSteps(), "Happy Path Scenario [for Happiness]", new List<string>())),
                new Story(storyMetadata1, new Scenario(typeof(SadPathScenario), GetFailingExecutionSteps(), "Sad Path Scenario [for Happiness]", new List<string>())),
                new Story(storyMetadata1, new Scenario(typeof(SadPathScenario), GetInconclusiveExecutionSteps(), "Inconclusive Scenario [for Happiness]", new List<string>())),
                new Story(storyMetadata1, new Scenario(typeof(SadPathScenario), GetNotImplementedExecutionSteps(), "Not Implemented Scenario [for Happiness]", new List<string>())),
                new Story(testThatReportWorksWithNoStory, new Scenario(typeof(HappyPathScenario), GetHappyExecutionSteps(), "Happy Path Scenario [with no story]", new List<string>())),
                new Story(testThatReportWorksWithNoStory, new Scenario(typeof(SadPathScenario), GetFailingExecutionSteps(), "Sad Path Scenario [with no story]", new List<string>())),
                new Story(testThatReportWorksWithNoStory, new Scenario(typeof(SadPathScenario), GetInconclusiveExecutionSteps(), "Inconclusive Scenario [with no story]", new List<string>())),
                new Story(testThatReportWorksWithNoStory, new Scenario(typeof(SadPathScenario), GetNotImplementedExecutionSteps(), "Not Implemented Scenario [with no story]", new List<string>())),
                new Story(storyMetadata2, GetScenarios(true, true)),
                new Story(storyMetadata3, GetScenarios(false, true)),
            };

            return stories;
        }