示例#1
0
        public void CreateLoanApplication_ShouldReturnIdOfAddedModel()
        {
            const int id         = 123;
            var       model      = LoanApplicationModelFactory.CreateBasicModel().WithId(id);
            var       newModelId = _target.CreateLoanApplication(model);

            newModelId.Should().Be(id);
        }
示例#2
0
        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));
        }