Ejemplo n.º 1
0
        public void ThenSectionTextIsCorrect()
        {
            var          fixtureMock = new Mock <IFixture>();
            IBddScenario scenario    = CreateScenario(fixtureMock.Object);

            scenario.GetDescription().Then.ShouldBe($"Then result 1 is as expected{Environment.NewLine}\tAnd result 2 is as expected");
        }
Ejemplo n.º 2
0
        public void WhenSectionTextIsCorrect()
        {
            var          fixtureMock = new Mock <IFixture>();
            IBddScenario scenario    = CreateScenario(fixtureMock.Object);

            scenario.GetDescription().When.ShouldBe("When something is done");
        }
Ejemplo n.º 3
0
        public void GivenSectionTextIsCorrect()
        {
            var          fixtureMock = new Mock <IFixture>();
            IBddScenario scenario    = CreateScenario(fixtureMock.Object);

            scenario.GetDescription().Given.ShouldBe($"Given first fact{Environment.NewLine}\tAnd second fact");
        }
Ejemplo n.º 4
0
        public void CustomTitleIsCorrect()
        {
            var          fixtureMock = new Mock <IFixture>();
            const string title       = "Custom title";
            IBddScenario scenario    = CreateScenario(fixtureMock.Object, title);

            scenario.GetDescription().Title.ShouldBe(title);
        }
Ejemplo n.º 5
0
        public void DescriptionIsCorrectlyComposedFromSections()
        {
            var          fixtureMock = new Mock <IFixture>();
            IBddScenario scenario    = CreateScenario(fixtureMock.Object);

            IBddScenarioDescription description = scenario.GetDescription();
            string newLine = Environment.NewLine;

            description.ToString().ShouldBe($"{description.Title}{newLine}{description.Given}{newLine}{description.When}{newLine}{description.Then}{newLine}");
        }
Ejemplo n.º 6
0
        public void DefaultTitleIsEqualToHumanizedMethodName()
        {
            var          fixtureMock = new Mock <IFixture>();
            IBddScenario scenario    = BddScenario
                                       .Given(fixtureMock.Object)
                                       .Given(f => f.FirstFact())
                                       .And(f => f.SecondFact())
                                       .When(f => f.SomethingIsDone())
                                       .Then(f => f.Result1IsAsExpected())
                                       .And(f => f.Result2IsAsExpected())
                                       .Create();

            scenario.GetDescription().Title.ShouldBe("Default title is equal to humanized method name");
        }