public void ShouldGetErrorResponseForStepValidateRequestWhennNoImplFound() { var messageProcessor = _messageProcessorFactory.GetProcessor(Message.Types.MessageType.StepValidateRequest); var request = new StepValidateRequest { StepText = "step_text_1", NumberOfParameters = 0 }; var message = new Message { MessageId = 1, MessageType = Message.Types.MessageType.StepValidateRequest, StepValidateRequest = request }; var response = messageProcessor.Process(message); Assert.AreEqual(false, response.StepValidateResponse.IsValid); Assert.AreEqual(StepValidateResponse.Types.ErrorType.StepImplementationNotFound, response.StepValidateResponse.ErrorType); StringAssert.Contains("No implementation found for : step_text_1.", response.StepValidateResponse.ErrorMessage); }
public void ShouldGetErrorResponseForStepValidateRequestWhenMultipleStepImplFound() { var messageProcessor = _messageProcessorFactory.GetProcessor(Message.Types.MessageType.StepValidateRequest); var request = new StepValidateRequest() { StepText = "step_text_1", NumberOfParameters = 0, }; var message = new Message() { MessageId = 1, MessageType = Message.Types.MessageType.StepValidateRequest, StepValidateRequest = request }; _mockStepRegistry.Setup(registry => registry.ContainsStep("step_text_1")).Returns(true); _mockStepRegistry.Setup(registry => registry.HasMultipleImplementations("step_text_1")).Returns(true); var response = messageProcessor.Process(message); Assert.AreEqual(false, response.StepValidateResponse.IsValid); Assert.AreEqual(StepValidateResponse.Types.ErrorType.DuplicateStepImplementation, response.StepValidateResponse.ErrorType); Assert.AreEqual("Multiple step implementations found for : step_text_1", response.StepValidateResponse.ErrorMessage); }
public override Task <StepValidateResponse> ValidateStep(StepValidateRequest request, ServerCallContext context) { return(Task.FromResult(this.stepValidateRequestProcessor.Process(request))); }
public override Task <StepValidateResponse> ValidateStep(StepValidateRequest request, ServerCallContext context) { return(_pool.Execute(DefaultExecutionStream, () => this.stepValidateRequestProcessor.Process(request))); }