コード例 #1
0
        public void Should_not_execute_step_argument_transformations_when_there_was_an_error_earlier()
        {
            var testExecutionEngine = CreateTestExecutionEngine();

            var bindingTypeStub = new Mock<IBindingType>();
            RegisterStepDefinitionWithTransformation(bindingTypeStub.Object);

            scenarioContext.ScenarioExecutionStatus = ScenarioExecutionStatus.TestError;

            UserCreator stepTransformationInstance = new UserCreator();
            var transformMethod = new RuntimeBindingMethod(stepTransformationInstance.GetType().GetMethod("Create"));
            var stepTransformationBinding = CreateStepTransformationBinding(@"user (\w+)", transformMethod);
            stepTransformations.Add(stepTransformationBinding);

            testExecutionEngine.Step(StepDefinitionKeyword.Given, null, "user bar", null, null);

            _stepArgumentTypeConverterMock.Verify(i => i.Convert(It.IsAny<object>(), bindingTypeStub.Object, It.IsAny<CultureInfo>()), Times.Never);
        }