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"); }
public void WhenSectionTextIsCorrect() { var fixtureMock = new Mock <IFixture>(); IBddScenario scenario = CreateScenario(fixtureMock.Object); scenario.GetDescription().When.ShouldBe("When something is done"); }
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"); }
public void CustomTitleIsCorrect() { var fixtureMock = new Mock <IFixture>(); const string title = "Custom title"; IBddScenario scenario = CreateScenario(fixtureMock.Object, title); scenario.GetDescription().Title.ShouldBe(title); }
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}"); }
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"); }