public void Deserialize_Report()
        {
            TelemetryReport tempReport = new TelemetryReport();

            tempReport.LogDataPoint("int", 5);
            tempReport.LogDataPoint("string", "foo");
            tempReport.LogDataPoint("double", 3.14);
            tempReport.LogDataPoint("bool", true);

            tempReport.SetLogTime(DateTime.UtcNow);
            tempReport.ErrorCode  = 7;
            tempReport.StatusCode = 5;

            JsonSerializer serializer = new JsonSerializer();
            string         result     = serializer.SerializeToText(tempReport);

            TelemetryReport report = serializer.DeserializeReports(result)[0];

            Assert.AreEqual(DateTime.UtcNow.Year, report.ActivityTime.Year);
            Assert.AreEqual(5, report.StatusCode);
            Assert.AreEqual(7, report.ErrorCode);

            Assert.AreEqual((long)5, report.GetDataPointValue("int"));
            Assert.AreEqual("foo", report.GetDataPointValue("string"));
            Assert.AreEqual(3.14, report.GetDataPointValue("double"));
            Assert.AreEqual(true, report.GetDataPointValue("bool"));
        }
        public override Task SaveToStorageAsync(TelemetryReport report)
        {
            // Determine PartitionKey
            var pkVar = report.GetDataPointValue("_telemAzurePartitionKey") as string;

            if (pkVar != null)
            {
                report.DeleteDataPoint("_telemAzurePartitionKey");
            }
            var pk = ((pkVar != null) ? pkVar : StorageSettings.DefaultPartitionKey);

#if WINDOWS_APP
            return(StorageTable.ExecuteAsync(BuildInsertOperation(report, pk)).AsTask());
#else
            return(StorageTable.ExecuteAsync(BuildInsertOperation(report, pk)));
#endif
        }