public void PerformanceCounterTelemetryDeepCloneWithNullExtensionDoesNotThrow() { var telemetry = new PerformanceCounterTelemetry(); // Extension is not set, means it'll be null. // Validate that cloning with null Extension does not throw. var other = telemetry.DeepClone(); }
public void PerformanceCounterTelemetryDeepCloneCopiesAllProperties() { PerformanceCounterTelemetry item = new PerformanceCounterTelemetry("someCategory", "someCounter", "an instance", 15.7); item.Timestamp = DateTimeOffset.Now; item.Properties.Add("p1", "p1Val"); PerformanceCounterTelemetry other = (PerformanceCounterTelemetry)item.DeepClone(); CompareLogic deepComparator = new CompareLogic(); var result = deepComparator.Compare(item, other); Assert.IsTrue(result.AreEqual, result.DifferencesString); }