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 TestDuplicateMeasureLongs() { AssertContains( MeasureMapBuilder.Builder().Put(M3, 100L).Put(M3, 100L).Build(), MeasurementLong.Create(M3, 100L)); AssertContains( MeasureMapBuilder.Builder().Put(M3, 100L).Put(M3, 200L).Put(M3, 300L).Build(), MeasurementLong.Create(M3, 300L)); AssertContains( MeasureMapBuilder.Builder().Put(M3, 100L).Put(M4, 200L).Put(M3, 300L).Build(), MeasurementLong.Create(M3, 300L), MeasurementLong.Create(M4, 200L)); AssertContains( MeasureMapBuilder.Builder().Put(M3, 100L).Put(M3, 200L).Put(M4, 200L).Build(), MeasurementLong.Create(M3, 200L), MeasurementLong.Create(M4, 200L)); }
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 TestBuilderEmpty() { IList <IMeasurement> metrics = MeasureMapBuilder.Builder().Build(); AssertContains(metrics); }
public void TestPutLong() { IList <IMeasurement> metrics = MeasureMapBuilder.Builder().Put(M3, 9999L).Put(M4, 8888L).Build(); AssertContains(metrics, MeasurementLong.Create(M3, 9999L), MeasurementLong.Create(M4, 8888L)); }
public void TestPutDouble() { IList <IMeasurement> metrics = MeasureMapBuilder.Builder().Put(M1, 44.4).Build(); AssertContains(metrics, MeasurementDouble.Create(M1, 44.4)); }
public void TestBuilderEmpty() { var metrics = MeasureMapBuilder.Builder().Build(); AssertContains(metrics); }
public void TestBuilderEmpty() { var metrics = MeasureMapBuilder.Builder().Build(); AssertCollectionsAreSame(metrics); }
public void TestPutLong() { var metrics = MeasureMapBuilder.Builder().Put(M3, 9999L).Put(M4, 8888L).Build(); AssertCollectionsAreSame(metrics, MeasurementLong.Create(M3, 9999L), MeasurementLong.Create(M4, 8888L)); }
public void TestPutDouble() { var metrics = MeasureMapBuilder.Builder().Put(M1, 44.4).Build(); AssertCollectionsAreSame(metrics, MeasurementDouble.Create(M1, 44.4)); }