public void CreateLoanApplication_ShouldReturnIdOfAddedModel() { const int id = 123; var model = LoanApplicationModelFactory.CreateBasicModel().WithId(id); var newModelId = _target.CreateLoanApplication(model); newModelId.Should().Be(id); }
public IActionResult Add([FromBody] LoanApplicationModel model) { if (model == null) { BadRequest(); } // TODO: This should make sure all values are set (no null values) if (!ModelState.IsValid) { return(UnprocessableEntity()); } var id = _loanApplicationLogic.CreateLoanApplication(model); return(Ok(id)); }