public void SetUp() { this.stream = new MemoryStream(); this.streamManager = new RecyclableMemoryStreamManager(1 << 17, 2, 1 << 24); this.dimensions = new DimensionSet(new HashSet<Dimension>(new[] {new Dimension(AnyDimension)})); this.data = new KeyedDataStore<InternalHitCount>(this.dimensions, this.streamManager); var hitCount = new InternalHitCount(); hitCount.AddValue(AnyDataValue); this.data.AddValue(new DimensionSpecification {{AnyDimension, AnyDimensionValue}}, AnyDataValue); this.data.Merge(); }
public void SetUp() { this.stream = new MemoryStream(); this.streamManager = new RecyclableMemoryStreamManager(1 << 17, 2, 1 << 24); this.dimensions = new DimensionSet(new HashSet <Dimension>(new[] { new Dimension(AnyDimension) })); this.data = new KeyedDataStore <InternalHitCount>(this.dimensions, this.streamManager); var hitCount = new InternalHitCount(); hitCount.AddValue(AnyDataValue); this.data.AddValue(new DimensionSpecification { { AnyDimension, AnyDimensionValue } }, AnyDataValue); this.data.Merge(); }
public unsafe void HitCountReadAddsToCurrentValue() { const ulong anyHitCount = 42; var hitCount = new InternalHitCount(); hitCount.AddValue(37); var hitCountBytes = BitConverter.GetBytes(anyHitCount); fixed(byte *buf = hitCountBytes) { hitCount.ReadFromPersistedData(buf, sizeof(ulong), false); } Assert.AreEqual(anyHitCount + 37, hitCount.HitCount); }