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)); }
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); } }
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)); }
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)); }
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)); }
public void TestPutDouble() { IList <IMeasurement> metrics = MeasureMapBuilder.Builder().Put(M1, 44.4).Build(); AssertContains(metrics, MeasurementDouble.Create(M1, 44.4)); }
internal MeasureMapBuilder Put(IMeasureDouble measure, double value) { measurements.Add(MeasurementDouble.Create(measure, value)); return(this); }
public void TestPutDouble() { var metrics = MeasureMapBuilder.Builder().Put(M1, 44.4).Build(); AssertCollectionsAreSame(metrics, MeasurementDouble.Create(M1, 44.4)); }