public void AddMetric_AddSingleMetric_MetricIsStored()
        {
            MethodMetric sut = new MethodMetric("Test");
            var metric = new Metric("Metric1", 10);

            sut.AddMetric(metric);

            Assert.AreEqual(metric, sut.Metrics.First(), "Not equal");
            Assert.AreEqual(1, sut.Metrics.Count(), "Wrong number of classes");
        }
        public void Merge_MergeMethodMetric_MetricsAreStored()
        {
            var metric1 = new Metric("Metric1", 10);
            var metric2 = new Metric("Metric1", 15);
            var metric3 = new Metric("Metric2", 20);

            MethodMetric sut = new MethodMetric("Test", new[] { metric1 });
            var methodMetricToMerge = new MethodMetric("Test", new[] { metric2, metric3 });

            sut.Merge(methodMetricToMerge);

            Assert.AreEqual(2, sut.Metrics.Count(), "Wrong number of classes");
            Assert.AreEqual(metric1, sut.Metrics.First(), "Not equal");
            Assert.AreEqual(15, sut.Metrics.First().Value, "Not equal");
            Assert.AreEqual(metric3, sut.Metrics.ElementAt(1), "Not equal");
        }
 /// <summary>
 /// Adds the given metric.
 /// </summary>
 /// <param name="metric">The metric.</param>
 internal void AddMetric(Metric metric)
 {
     this.metrics.Add(metric);
 }
 /// <summary>
 /// Adds the given metric.
 /// </summary>
 /// <param name="metric">The metric.</param>
 public void AddMetric(Metric metric)
 {
     this.metrics.Add(metric);
 }
Example #5
0
 /// <summary>
 /// Adds the given metric.
 /// </summary>
 /// <param name="metric">The metric.</param>
 internal void AddMetric(Metric metric)
 {
     this.metrics.Add(metric);
 }