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)); }
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\"")); }
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); }