コード例 #1
0
        public void ShouldInforStudentGrade()
        {
            var expectedStudentGrade = 8;

            _registrationRepository.Setup(r => r.GetByIdWithIncludes(_registration.Id)).Returns(_registration);

            _registrationConclusion.Conclude(_registration.Id, expectedStudentGrade);

            Assert.Equal(expectedStudentGrade, _registration.StudentGrade);
        }
コード例 #2
0
        public IActionResult Conclusion(ConclusionDto model)
        {
            try
            {
                _registrationConclusion.Conclude(model.RegistrationId, model.ExpectedGrade);
            }
            catch (DomainException exception)
            {
                return(new JsonResult(exception.ListOfRules));
            }
            catch (Exception ex)
            {
                return(new JsonResult(ex.Message));
            }

            return(Ok());
        }