public void Copy_retains_all_public_properties() { var source = Create(DefautltLowestDiscernibleValue, DefaultHighestTrackableValue, DefaultSignificantFigures); var copy = source.Copy(); HistogramAssert.AreValueEqual(source, copy); }
public void Given_a_Histogram_populated_with_full_range_of_values_When_encoded_and_decoded_with_compression_Then_data_is_preserved() { var source = Create(HighestTrackableValue, 3); LoadFullRange(source); var result = CompressedEncodeDecode(source); HistogramAssert.AreEqual(source, result); }
public void Given_a_populated_Histogram_When_encoded_and_decoded_Then_data_is_preserved() { var source = Create(HighestTrackableValue, 3); Load(source); var result = EncodeDecode(source); HistogramAssert.AreEqual(source, result); }
public void Given_a_Histogram_populated_with_full_range_of_values_When_encoded_and_decoded_Then_data_is_preserved() { var source = Create(DefaultHighestTrackableValue, DefaultSignificantFigures); LoadFullRange(source); var result = EncodeDecode(source); HistogramAssert.AreValueEqual(source, result); }
public void Given_a_populated_Histogram_When_encoded_and_decoded_with_compression_Then_data_is_preserved() { var source = Create(DefaultHighestTrackableValue, DefaultSignificantFigures); Load(source); var result = CompressedEncodeDecode(source); HistogramAssert.AreValueEqual(source, result); }
private void CreateAndAdd(HistogramBase source) { source.RecordValueWithCount(1, 100); source.RecordValueWithCount(int.MaxValue - 1, 1000); var target = Create(source.LowestTrackableValue, source.HighestTrackableValue, source.NumberOfSignificantValueDigits); target.Add(source); HistogramAssert.AreValueEqual(source, target); }
public void CanRoundTripSingleHsitogram() { var histogram = CreatePopulatedHistogram(1000); var startTimeWritten = DateTime.Now; var endTimeWritten = startTimeWritten.AddMinutes(30); histogram.StartTimeStamp = startTimeWritten.MillisecondsSinceUnixEpoch(); histogram.EndTimeStamp = endTimeWritten.MillisecondsSinceUnixEpoch(); var data = WriteLog(startTimeWritten, histogram); var actualHistograms = ReadHistograms(data); Assert.AreEqual(1, actualHistograms.Length); HistogramAssert.AreEqual(histogram, actualHistograms.Single()); }