Esempio n. 1
0
        /// <summary>
        /// Save Symptom Data of user
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool SendSymptomeDataSet(SymptomeInputDataSet data)
        {
            try
            {
                lock (tableLock)
                {
                    table.Add(new UserDataSet()
                    {
                        Ident = data.userID, Time = data.time, Symptomes = data.symptomes, GeoProfile = data.geodata, Acknowledments = new List <DiseaseAcknowledgement>(), ExtPropabilities = null, RawPropabilities = null
                    });
                }

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Esempio n. 2
0
 public void SendSymptomeDataSet([FromBody] SymptomeInputDataSet value)
 {
     dataService.SendSymptomeDataSet(value);
 }
Esempio n. 3
0
        public void SendSymptomeDataSet()
        {
            // arrange
            var _client = new HttpClient();

            SymptomeInputDataSet resData = new SymptomeInputDataSet()
            {
                userID    = Guid.Parse(Constants.userID),
                time      = DateTime.Parse(Constants.lastTime),
                geodata   = new List <GeoData>(),
                symptomes = new List <SymptomeInputData>()
                {
                    new SymptomeInputData()
                    {
                        id = "R50.9", strength = 38.8f
                    },
                    new SymptomeInputData()
                    {
                        id = "R05", strength = 80f
                    },
                    new SymptomeInputData()
                    {
                        id = "R53", strength = 60f
                    },
                    new SymptomeInputData()
                    {
                        id = "R06.0", strength = 30f
                    },
                    new SymptomeInputData()
                    {
                        id = "M79.6", strength = 40f
                    },
                    new SymptomeInputData()
                    {
                        id = "R07.0", strength = 30f
                    },
                    new SymptomeInputData()
                    {
                        id = "R51", strength = 20f
                    },
                    new SymptomeInputData()
                    {
                        id = "R68.8", strength = 70f
                    },
                    new SymptomeInputData()
                    {
                        id = "R11", strength = 0f
                    },
                    new SymptomeInputData()
                    {
                        id = "R06.8", strength = 40f
                    },
                    new SymptomeInputData()
                    {
                        id = "A09.0", strength = 0f
                    }
                }
            };
            var json    = JsonConvert.SerializeObject(resData);
            var content = new StringContent(json, Encoding.UTF8, "application/json");

            //act
            HttpResponseMessage response = _client.PostAsync(new Uri(Constants.url + "/api/symptome/sendsymptomedataset"), content).Result;



            Assert.IsTrue(response.IsSuccessStatusCode, "Statuscode " + response.StatusCode + " returned");

            // assert
            Assert.IsNotNull(response.Content);
        }