public void Test_GetPatientAchievements()
        {
            // Arrange
            var newGoal = new ActivityGoal {
                Id              = patientId,
                Steps           = patientSteps,
                ActiveMinutes   = activeMinutes,
                WalkingMinutes  = walkingMinutes,
                StandingMinutes = standingMinutes
            };

            context.ActivityGoals.Add(newGoal);

            context.SaveChanges();

            var evaluator = new PatientsEvaluator(context);

            // Act
            var activityResult = evaluator.GetPatientAchievements(patientId) as JsonResult;

            // Assert
            var activity = (ActivityGoal)activityResult.Value;

            Assert.Same(newGoal, activity);
        }
Пример #2
0
 public IActionResult GetPatientAchievements(int patientId)
 {
     try
     {
         return(evaluator.GetPatientAchievements(patientId));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }