public void GetHealthKitData_RequestsHealthKitDataForUserId_ReturnsCorrectRecordsFromServer()
        {
            var testData = SetUpSingleHealthKitDataObject();

            var healthKitDataFromServer = m_healthKitDataWebClient.GetHealtKitDataFromHealthKitServer(HealthKitServerGetUsersRecordsUrl, testData.PersonId);

            Assert.IsNotNull(healthKitDataFromServer);
            Assert.IsTrue(healthKitDataFromServer.ToList().Any(x => x.PersonId == testData.PersonId));
        }
Example #2
0
        private void GetDataFromHealthKitServer(object o = null)
        {
            var response = m_healthKitDataWebService.GetHealtKitDataFromHealthKitServer(m_healthKitServerGetAPIAddress, 3);

            if (response != null)
            {
                if (m_healthKitDataFromServer.Any())
                {
                    // till next Xamarin Update
                    int temp = m_healthKitDataFromServer.Count;
                    for (int i = 0; i < temp; i++)
                    {
                        m_healthKitDataFromServer.RemoveAt(0);
                    }
                    ;
                    //m_healthKitDataFromServer.Clear ();
                }
                foreach (var data in response.ToList())
                {
                    m_healthKitDataFromServer.Add(data);
                }
            }
        }