コード例 #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;
        }
コード例 #2
0
ファイル: Story.cs プロジェクト: zabing/TestStack.BDDfy
        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;
            }
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #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;
        }