Ejemplo n.º 1
0
 public static void VerifyTelemetryEventData(ActionEventBase expected, TelemetryEvent actual)
 {
     Assert.Equal(expected.OperationId, actual.Properties[TelemetryConstants.OperationIdPropertyName].ToString());
     Assert.Equal(string.Join(",", expected.ProjectIds), actual.Properties[TelemetryConstants.ProjectIdsPropertyName].ToString());
     Assert.Equal(expected.PackagesCount, (int)actual.Properties[TelemetryConstants.PackagesCountPropertyName]);
     Assert.Equal(expected.Status.ToString(), actual.Properties[TelemetryConstants.OperationStatusPropertyName].ToString());
     Assert.Equal(expected.StartTime.ToString(), actual.Properties[TelemetryConstants.StartTimePropertyName].ToString());
     Assert.Equal(expected.EndTime.ToString(), actual.Properties[TelemetryConstants.EndTimePropertyName].ToString());
     Assert.Equal(expected.Duration, (double)actual.Properties[TelemetryConstants.DurationPropertyName]);
 }
Ejemplo n.º 2
0
 public static void VerifyTelemetryEventData(string operationId, ActionEventBase expected, TelemetryEvent actual)
 {
     Assert.Equal(operationId, actual["OperationId"].ToString());
     Assert.Equal(expected.ProjectsCount, (int)actual["ProjectsCount"]);
     Assert.Equal(string.Join(",", expected.ProjectIds), actual["ProjectIds"].ToString());
     Assert.Equal(expected.PackagesCount, (int)actual["PackagesCount"]);
     Assert.Equal(expected.Status.ToString(), actual["Status"].ToString());
     Assert.Equal(expected.StartTime, actual["StartTime"]);
     Assert.Equal(expected.EndTime, actual["EndTime"]);
     Assert.Equal(expected.Duration, (double)actual["Duration"]);
 }
        public static void VerifyTelemetryEventData(string operationId, ActionEventBase expected, TelemetryEvent actual)
        {
            Assert.Equal(operationId, actual["OperationId"].ToString());
            Assert.Equal(expected.ProjectsCount, (int)actual["ProjectsCount"]);
            Assert.Equal(expected.PackagesCount, (int)actual["PackagesCount"]);
            Assert.Equal(expected.Status.ToString(), actual["Status"].ToString());
            Assert.Equal(expected.StartTime, actual["StartTime"]);
            Assert.Equal(expected.EndTime, actual["EndTime"]);
            Assert.Equal(expected.Duration, (double)actual["Duration"]);

            TelemetryUtility.VerifyDateTimeFormat(actual["StartTime"] as string);
            TelemetryUtility.VerifyDateTimeFormat(actual["EndTime"] as string);

            for (var i = 0; i < expected.ProjectsCount; i++)
            {
                Assert.Equal(expected.ProjectIds[i], actual["ProjectId" + (i + 1)].ToString());
            }
        }