Example #1
0
        public void MetricEqualsItself()
        {
            using (var manager = new MetricManagerV1())
            {
                MetricV1 metric = manager.CreateMetric("My metric");

                Assert.IsTrue(metric.Equals(metric));
            }
        }
Example #2
0
        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));
            }
        }
Example #3
0
        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));
            }
        }
Example #4
0
        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));
            }
        }
Example #5
0
        public void MetricNotEqualsOtherObject()
        {
            using (var manager = new MetricManagerV1())
            {
                MetricV1 metric = manager.CreateMetric("My metric");
                var      other  = new object();

                Assert.IsFalse(metric.Equals(other));
            }
        }
Example #6
0
        public void MetricNeverEqualsNull()
        {
            using (var manager = new MetricManagerV1())
            {
                MetricV1 metric = manager.CreateMetric("My metric");
                object   other  = null;

                Assert.IsFalse(metric.Equals(other));
            }
        }
Example #7
0
        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));
            }
        }
Example #8
0
        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));
            }
        }