Ejemplo n.º 1
0
        public void TestStatusReportForRetrySerialization()
        {
            SettingsManager.RemoveString(RETRY_DEPLOYMENT_REPORT_KEY);
            var original = new JObject();

            original.Add("keyString", "stringValue");
            original.Add("keyInt", 42);
            original.Add("keyBool", true);

            TelemetryManager.SaveStatusReportForRetry(original);

            var stringified = SettingsManager.GetString(RETRY_DEPLOYMENT_REPORT_KEY);

            SettingsManager.RemoveString(RETRY_DEPLOYMENT_REPORT_KEY);

            Assert.IsNotNull(stringified);
            var result = JObject.Parse(stringified);

            Assert.IsTrue((bool)result.GetValue("keyBool"));
            Assert.AreEqual(42, (int)result.GetValue("keyInt"));
            Assert.AreEqual("stringValue", (string)result.GetValue("keyString"));
        }