public void IdentifyStepsMarkedAsMustNotEventuallyFail() { var step = new ThenStep("this eventually succeeds", null, null); var method = typeof(StepBindingEventuallyConsistentStepSamples).GetMethod("FailsOnSecondCallMarkedAsMustNotEventuallyFail"); var binding = new StepBinding(step, method, Array.Empty <object>()); Assert.IsTrue(binding.IsMarkedMustNotEventuallyFail); }
public void IdentifyStepsMarkedAsEventuallySuccessfull() { var step = new ThenStep("this eventually succeeds", null, null); var method = typeof(StepBindingEventuallyConsistentStepSamples).GetMethod("ThenThisEventuallySucceeds"); var binding = new StepBinding(step, method, Array.Empty <object>()); Assert.IsTrue(binding.IsSuccessEventual); }
public override Task Execute(State state) { if (!state.TryExtractFlag(Description.Name.Names, out _, out var newState)) { return(GetNextStep().Execute(state)); } else { return(ThenStep.ParseFromState(newState)); } }
private async Task <TestResultMessage[]> PerformEventuallyConsistentScenarioTest(MethodInfo givenMethod, MethodInfo whenMethod, MethodInfo thenMethod) { var givenStep = new GivenStep("Given", DataTable.Empty, null); var whenStep = new WhenStep("When", DataTable.Empty, null); var thenStep = new ThenStep("Then", DataTable.Empty, null); var testFeature = new Feature( "Feature", null, Background.Empty, new[] { new Scenario( "Scenario", new IStep[] { givenStep, whenStep, thenStep }, 1, new List <Tag> { new Tag("eventuallyConsistent(retryInterval=00:00:01;within=00:00:05)") }) }, Enumerable.Empty <ScenarioOutline>(), Enumerable.Empty <Rule>(), Enumerable.Empty <Tag>()); var testData = new DiscoveredTestData(testAssembly, testFeature, null, testFeature.Scenarios.First()); var givenStepBinding = new StepBinding(givenStep, givenMethod, Array.Empty <object>()); var whenStepBinding = new StepBinding(whenStep, whenMethod, Array.Empty <object>()); var thenStepBinding = new StepBinding(thenStep, thenMethod, Array.Empty <object>()); mockStepBinder .Setup(m => m.GetBindingFor(givenStep, testAssembly)) .Returns(givenStepBinding); mockStepBinder .Setup(m => m.GetBindingFor(whenStep, testAssembly)) .Returns(whenStepBinding); mockStepBinder .Setup(m => m.GetBindingFor(thenStep, testAssembly)) .Returns(thenStepBinding); var testResult = await stepsExecutor.Execute(testCase, testData, testRunContext, mockLogger.Object); return(testResult .Messages .Where( message => message.Category == TestResultMessage.StandardOutCategory) .ToArray()); }
private IFixtureStepRunner RunnerOf(ThenStep step) => new ThenStepRunner(step);
protected static void I_have_a_then_condition() { then = new ThenStep(new Scenario(), dummy_step, StepPrefix.Then); }