Exemplo n.º 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));
        }
Exemplo n.º 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\""));
        }
Exemplo n.º 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);
        }