public void MetricEqualsItself() { using (var manager = new MetricManagerV1()) { MetricV1 metric = manager.CreateMetric("My metric"); Assert.IsTrue(metric.Equals(metric)); } }
public void MetricsAreEqualIfDimensionsSetToNothingImplicitlyAndExplicitlyAsEmptySet() { using (var manager = new MetricManagerV1()) { MetricV1 metric = manager.CreateMetric("My metric", new Dictionary <string, string>()); MetricV1 other = manager.CreateMetric("My metric"); Assert.IsTrue(metric.Equals(other)); } }
public void MetricNameIsAccentSensitive() { using (var manager = new MetricManagerV1()) { MetricV1 metric = manager.CreateMetric("My metric"); MetricV1 other = manager.CreateMetric("My métric"); Assert.IsFalse(metric.Equals(other)); } }
public void MetricsAreEqualForTheSameMetricNameWithoutDimensions() { using (var manager = new MetricManagerV1()) { MetricV1 metric = manager.CreateMetric("My metric"); MetricV1 other = manager.CreateMetric("My metric"); Assert.IsTrue(metric.Equals(other)); } }
public void MetricNotEqualsOtherObject() { using (var manager = new MetricManagerV1()) { MetricV1 metric = manager.CreateMetric("My metric"); var other = new object(); Assert.IsFalse(metric.Equals(other)); } }
public void MetricNeverEqualsNull() { using (var manager = new MetricManagerV1()) { MetricV1 metric = manager.CreateMetric("My metric"); object other = null; Assert.IsFalse(metric.Equals(other)); } }
public void DimensionValuesAreAccentSensitive() { using (var manager = new MetricManagerV1()) { var dimensionSet1 = new Dictionary <string, string>() { { "Dim1", "Value1" } }; var dimensionSet2 = new Dictionary <string, string>() { { "Dim1", "Válue1" } }; MetricV1 metric = manager.CreateMetric("My metric", dimensionSet1); MetricV1 other = manager.CreateMetric("My metric", dimensionSet2); Assert.IsFalse(metric.Equals(other)); } }
public void DimensionsAreOrderInsensitive() { using (var manager = new MetricManagerV1()) { var dimensionSet1 = new Dictionary <string, string>() { { "Dim1", "Value1" }, { "Dim2", "Value2" }, }; var dimensionSet2 = new Dictionary <string, string>() { { "Dim2", "Value2" }, { "Dim1", "Value1" }, }; MetricV1 metric = manager.CreateMetric("My metric", dimensionSet1); MetricV1 other = manager.CreateMetric("My metric", dimensionSet2); Assert.IsTrue(metric.Equals(other)); } }