Пример #1
0
        public void ShouldProvideTheWhenSentencePartOfTheText()
        {
            // prepare
            const string delimiter = ":";
            var scenario = new FeatureFileScenarioComponent(delimiter);
            scenario.Text = scenarioBody;

            // do
            var when = scenario.WhenStatement;

            // assert
            Assert.IsNotNull(when);
            Assert.AreNotEqual(string.Empty, when);

            var isWhenStatement = when.StartsWith(FeatureFileScenarioComponent.TOKEN_SCENARIO_WHEN_INDICATOR, StringComparison.OrdinalIgnoreCase);
            Assert.IsTrue(isWhenStatement);
        }
Пример #2
0
        public void ShouldProvideTheGivenStatementPartOfTheText()
        {
            // prepare
            const string delimiter = ":";
            var scenario = new FeatureFileScenarioComponent(delimiter);
            scenario.Text = scenarioBody;

            // do
            var given = scenario.GivenStatement;

            // assert
            Assert.IsNotNull(given);
            Assert.AreNotEqual(string.Empty, given);

            var isGivenStatement =
                given.StartsWith(FeatureFileScenarioComponent.TOKEN_SCENARIO_GIVEN_INDICATOR_MALE, StringComparison.OrdinalIgnoreCase) ||
                given.StartsWith(FeatureFileScenarioComponent.TOKEN_SCENARIO_GIVEN_INDICATOR_FEMALE, StringComparison.OrdinalIgnoreCase);
            Assert.IsTrue(isGivenStatement);
        }