public IActionResult Get(string propertyReference) { var getPropertyChildrenRequest = new GetPropertyChildrenRequest { PropertyReference = propertyReference }; var response = _getPropertyChildrenUseCase.Execute(getPropertyChildrenRequest); Response?.Headers?.Add("Warning", "299 This endpoint is deprecated. Please use /properties/{propertyReference}/children instead"); return(Ok(response)); }
public IActionResult GetChildenProperties(string propertyReference) { _logger.LogInformation("Childen properties requested for " + propertyReference); var getPropertyChildrenRequest = new GetPropertyChildrenRequest { PropertyReference = propertyReference }; var response = _getPropertyChildrenUseCase.Execute(getPropertyChildrenRequest); return(Ok(response)); }
public void WhenExecutingCallsGatewayWithParameters(string propReference) { //arrange var request = new GetPropertyChildrenRequest { PropertyReference = propReference, }; //act var response = _classUnderTest.Execute(request); //assert _mockGateway.Verify(v => v.GetPropertyChildren(It.Is <string>(i => i == propReference)), Times.Once); }
public GetPropertyChildrenResponse Execute(GetPropertyChildrenRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } var response = _gateway.GetPropertyChildren(request.PropertyReference); return(new GetPropertyChildrenResponse { Children = response }); }