예제 #1
0
 public IActionResult AddPatientObservations(int userId, int patientId, string comment)
 {
     try
     {
         evaluator.AddPatientObservations(userId, patientId, comment);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        public void Test_AddPatientObservation()
        {
            // Arrange
            var evaluator = new PatientsEvaluator(context);

            // Act
            evaluator.AddPatientObservations(userId, patientId, userComment);

            // Assert
            var observationResult = (from observation in context.Observations
                                     where observation.UserId == userId && observation.PatientId == patientId
                                     select observation).First();

            Assert.Equal(observationResult.Comment, userComment);
        }