예제 #1
0
        public void Should_CalculateCorrectStepName_WhenReorderingTheParameters(string stepName, string originalStepRegex, string newRegex, string expectedStepName)
        {
            var binding = CreateStepDefinitionBinding(originalStepRegex);

            var sut    = new StepNameReplacer();
            var result = sut.BuildStepNameWithNewRegex(stepName, newRegex, binding);

            result.Should().Be(expectedStepName);
        }
예제 #2
0
        public void Should_ThrowAnException_WhenChangingTheNumberOfParameters()
        {
            var stepName      = "the number is 50";
            var originalRegex = "the number is (.*)";
            var newRegex      = "the numbers are (.*) and (.*)";
            var binding       = CreateStepDefinitionBinding(originalRegex);

            var sut = new StepNameReplacer();

            Assert.Throws <NotSupportedException>(() =>
                                                  sut.BuildStepNameWithNewRegex(stepName, newRegex, binding));
        }