public void Test_GetPatientActivity()
        {
            // Arrange
            context.Activities.Add(new Activity {
                Id        = activityId,
                PatientId = patientId,
                Start     = activityStart,
                End       = activityEnd,
                Type      = activityType
            });

            context.SaveChanges();

            var evaluator = new PatientsEvaluator(context);

            // Act
            var activity = evaluator.GetPatientActivity(patientId, activityStart, activityEnd);

            // Assert
            var activityResponse = JObject.Parse((string)activity.Value);
            var standingBarArray = activityResponse["standing"]["bar"];
            var t = standingBarArray.Values <int>();

            Assert.Equal(t.ToArray()[0], 1);
        }
Example #2
0
 public IActionResult GetPatientActivity(int patientId, long start, long end)
 {
     try
     {
         return(evaluator.GetPatientActivity(patientId, start, end));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }