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); }
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)); }