Example #1
0
        public void ShouldGetAndAddIntToNativeBuffer(IAtomicBuffer buffer)
        {
            Marshal.WriteInt32(buffer.BufferPointer, Index, IntValue);

            const int delta       = 1;
            var       beforeValue = buffer.GetAndAddInt(Index, delta);

            Assert.That(beforeValue, Is.EqualTo(IntValue));
            Assert.That(Marshal.ReadInt32(buffer.BufferPointer, Index), Is.EqualTo(IntValue + delta));
        }