//Main function to create pseudo database info
        private Result GetJsonResult(int mID, decimal currentMonthDataPoint, int dataPointID_1, short hasGoal, int goalID, decimal meetsVal, decimal meetsPlusVal, decimal exceedsVal, string operation, int dataType)
        {
            string name = "This is a name of a measurement";
            DateTime now = new DateTime(2015,07,01);

            JsonResult jsonResult = new JsonResult();

            List<DataPointViewModel> getMeasurementDataPointsList = new List<DataPointViewModel>();
            DataPointViewModel dataPoint = new DataPointViewModel();
            dataPoint.MeasurementID = mID;
            dataPoint.NameMeasurement = name;
            dataPoint.DataPointID = dataPointID_1;
            dataPoint.Applicable = now;
            dataPoint.Value = currentMonthDataPoint;
            dataPoint.NumType = dataType;
            getMeasurementDataPointsList.Add(dataPoint);

            List<BasicMeasurementData> getInfoHasGoal = new List<BasicMeasurementData>();
            BasicMeasurementData basicMeasurementData = new BasicMeasurementData();
            basicMeasurementData.MeasurementID = mID;
            basicMeasurementData.NameMeasurement = name;
            basicMeasurementData.HasGoal = hasGoal;
            getInfoHasGoal.Add(basicMeasurementData);

            List<GoalDataViewModel> getGoalData = new List<GoalDataViewModel>();
            GoalDataViewModel goalDataView = new GoalDataViewModel();
            goalDataView.GoalID = goalID;
            goalDataView.MeetsVal = meetsVal;
            goalDataView.MeetsPlusVal = meetsPlusVal;
            goalDataView.ExceedsVal = exceedsVal;
            goalDataView.Operation = operation;
            getGoalData.Add(goalDataView);

            _repository.Expect(x => x.GetInfoHasGoal(Arg<int>.Is.Anything)).Return(getInfoHasGoal);
            _repository.Expect(x => x.GetGoalData(Arg<int>.Is.Anything)).Return(getGoalData);
            _repository.Expect(x => x.GetMeasurementDataPoints(Arg<int>.Is.Anything, Arg<DateTime>.Is.Anything, Arg<DateTime>.Is.Anything)).Return(getMeasurementDataPointsList);
            _mocks.ReplayAll();

            jsonResult = _controller.GetMeasurementData(mID);
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            Result result = serializer.Deserialize<Result>(serializer.Serialize(jsonResult.Data));
            return result;
        }
 /// <summary>
 /// Creates a new instance of the DGoal class
 /// </summary>
 /// <param name="parent">DMeasurement hosting this DGoal</param>
 /// <param name="model">Model providing data for this DGoal</param>
 public DGoal(DMeasurement parent, Goal model)
 {
     this.Parent = parent;
     this.db = parent.db;
     this.Model = model;
     ViewModel = new GoalDataViewModel();
     ViewModel.AppliesAfter = model.Applies_After_Tmstp;
     ViewModel.ExceedsVal = model.Exceeds_Val;
     ViewModel.GoalID = model.Goal_ID;
     ViewModel.MeetsPlusVal = model.Meets_Plus_Val;
     ViewModel.MeetsVal = model.Meets_Val;
     ViewModel.Operation = model.Typ;
 }