Beispiel #1
0
        public void TestGetUpdateReportNegative()
        {
            var inputNoLabel = new JObject();

            inputNoLabel.Add(DEPLOYMENT_KEY_KEY, "depKeyParam");
            Assert.IsNull(TelemetryManager.GetUpdateReport(inputNoLabel));

            var inputNoKey = new JObject();

            inputNoKey.Add(LABEL_KEY, "labelParam");
            Assert.IsNull(TelemetryManager.GetUpdateReport(inputNoKey));
        }
Beispiel #2
0
        public void TestGetUpdateReportNoPreviousUpdate()
        {
            var input = new JObject();

            input.Add(DEPLOYMENT_KEY_KEY, "depKeyParam");
            input.Add(LABEL_KEY, "labelParam");

            var output = TelemetryManager.GetUpdateReport(input);

            Assert.IsNotNull(output);
            Assert.IsTrue(output.ToString(Formatting.None).Contains("\"status\":\"DeploymentSucceeded\""));
        }
Beispiel #3
0
        public void TestGetUpdateReportWithPreviousUpdate()
        {
            SettingsManager.SetString(LAST_DEPLOYMENT_REPORT_KEY, "prevKey:prevLabel");
            var input = new JObject();

            input.Add(DEPLOYMENT_KEY_KEY, "depKeyParam");
            input.Add(LABEL_KEY, "labelParam");

            var output = TelemetryManager.GetUpdateReport(input);

            Assert.IsNotNull(output);
            Assert.IsTrue(output.ToString(Formatting.None).Contains("\"status\":\"DeploymentSucceeded\""));
            Assert.IsTrue(output.ToString(Formatting.None).Contains("\"previousDeploymentKey\":\"prevKey\",\"previousLabelOrAppVersion\":\"prevLabel\""));

            //Clean Up
            SettingsManager.RemoveString(LAST_DEPLOYMENT_REPORT_KEY);
        }