public void CreateCancelMoveInForContractId_FailedOnCancel() { // Arrange var request = new CancelMoveInRequest() { ContractId = "a 123 % & -++_* bcdef" // bad input }; // Act var response = McfClient.PostCancelMoveIn(request); // Assert Assert.AreEqual(false, response.Result.Success); Assert.IsNotNull(response.Result.StatusMessage); }
/// <inheritdoc /> public async Task <CancelMoveInResponse> PostCancelMoveIn(CancelMoveInRequest request) { _logger.LogInformation($"Cancelling Move In: CancelMoveInForContractId({nameof(request)} : {request.ToJson()})"); try { var cancelResponse = await _mcfClient.PostCancelMoveIn(request); return(cancelResponse); } catch (Exception e) { _logger.LogError(e, "Failed to cancel move in."); throw e; } }
public async Task <IActionResult> CancelMoveIn([FromBody] CancelMoveInRequest cancelRequest) { _logger.LogInformation($"CancelMoveIn({nameof(cancelRequest)}): {cancelRequest.ToJson()}"); try { var result = await _moveInLogic.PostCancelMoveIn(cancelRequest); return(Ok(result)); } catch (Exception e) { _logger.LogError(e, "Unable to cancel move-in for contract.", e.Message); return(e.ToActionResult()); } }
public void CreateCancelMoveInForContractId_SuccessOnCancel() { /* * This might be tough to test, and may need to be done manually. * Each time a move-in is cancelled, I don't think that it can be re-cancelled. * A new move-in may need to be scheduled first, then cancelled. * If so, we should make the test schedule a move-in and then cancel it. */ // Arrange var request = new CancelMoveInRequest() { ContractId = "220015395001" // good input }; // Act var response = McfClient.PostCancelMoveIn(request); // Assert Assert.AreEqual(true, response.Result.Success); Assert.IsNotNull(response.Result.StatusMessage); }