コード例 #1
0
 public void TestDuplicateMeasures()
 {
     AssertContains(
         MeasureMapBuilder.Builder().Put(M3, 100L).Put(M1, 1.0).Put(M3, 300L).Build(),
         MeasurementLong.Create(M3, 300L),
         MeasurementDouble.Create(M1, 1.0));
     AssertContains(
         MeasureMapBuilder.Builder().Put(M2, 2.0).Put(M3, 100L).Put(M2, 3.0).Build(),
         MeasurementDouble.Create(M2, 3.0),
         MeasurementLong.Create(M3, 100L));
 }
コード例 #2
0
        public void TestBuilder()
        {
            IList <IMeasurement> expected = new List <IMeasurement>(10);
            MeasureMapBuilder    builder  = MeasureMapBuilder.Builder();

            for (int i = 1; i <= 10; i++)
            {
                expected.Add(MeasurementDouble.Create(MakeSimpleMeasureDouble("m" + i), i * 11.1));
                builder.Put(MakeSimpleMeasureDouble("m" + i), i * 11.1);
                var expArray = expected.ToArray();
                AssertContains(builder.Build(), expArray);
            }
        }
コード例 #3
0
        public void TestCombination()
        {
            IList <IMeasurement> metrics =
                MeasureMapBuilder.Builder()
                .Put(M1, 44.4)
                .Put(M2, 66.6)
                .Put(M3, 9999L)
                .Put(M4, 8888L)
                .Build();

            AssertContains(
                metrics,
                MeasurementDouble.Create(M1, 44.4), MeasurementDouble.Create(M2, 66.6),
                MeasurementLong.Create(M3, 9999L), MeasurementLong.Create(M4, 8888L));
        }
コード例 #4
0
        public void TestCombination()
        {
            var metrics =
                MeasureMapBuilder.Builder()
                .Put(M1, 44.4)
                .Put(M2, 66.6)
                .Put(M3, 9999L)
                .Put(M4, 8888L)
                .Build();

            AssertCollectionsAreSame(
                metrics,
                MeasurementDouble.Create(M1, 44.4), MeasurementDouble.Create(M2, 66.6),
                MeasurementLong.Create(M3, 9999L), MeasurementLong.Create(M4, 8888L));
        }
コード例 #5
0
 public void TestDuplicateMeasureDoubles()
 {
     AssertCollectionsAreSame(
         MeasureMapBuilder.Builder().Put(M1, 1.0).Put(M1, 2.0).Build(),
         MeasurementDouble.Create(M1, 2.0));
     AssertCollectionsAreSame(
         MeasureMapBuilder.Builder().Put(M1, 1.0).Put(M1, 2.0).Put(M1, 3.0).Build(),
         MeasurementDouble.Create(M1, 3.0));
     AssertCollectionsAreSame(
         MeasureMapBuilder.Builder().Put(M1, 1.0).Put(M2, 2.0).Put(M1, 3.0).Build(),
         MeasurementDouble.Create(M1, 3.0),
         MeasurementDouble.Create(M2, 2.0));
     AssertCollectionsAreSame(
         MeasureMapBuilder.Builder().Put(M1, 1.0).Put(M1, 2.0).Put(M2, 2.0).Build(),
         MeasurementDouble.Create(M1, 2.0),
         MeasurementDouble.Create(M2, 2.0));
 }
コード例 #6
0
        public void TestPutDouble()
        {
            IList <IMeasurement> metrics = MeasureMapBuilder.Builder().Put(M1, 44.4).Build();

            AssertContains(metrics, MeasurementDouble.Create(M1, 44.4));
        }
コード例 #7
0
 internal MeasureMapBuilder Put(IMeasureDouble measure, double value)
 {
     measurements.Add(MeasurementDouble.Create(measure, value));
     return(this);
 }
コード例 #8
0
        public void TestPutDouble()
        {
            var metrics = MeasureMapBuilder.Builder().Put(M1, 44.4).Build();

            AssertCollectionsAreSame(metrics, MeasurementDouble.Create(M1, 44.4));
        }