public void should_GetRaw() { var redisBuffer = new RedisBuffer(_64Bytes); for (byte index = 0; index < _64Bytes; index++) redisBuffer.WriteByte(index, index); var raw = redisBuffer.GetRaw(); for (byte index = 0; index < _64Bytes; index++) raw[index].Should().Be(index); }
public unsafe void should_GetAddressFromIndex() { var redisBuffer = new RedisBuffer(_64Bytes); byte* addressFromIndexZero = redisBuffer.GetAddressFromIndex(0); byte* addressFromIndexOne = redisBuffer.GetAddressFromIndex(1); (addressFromIndexZero < addressFromIndexOne).Should().BeTrue(); redisBuffer.WriteByte(65, 0); byte v = *addressFromIndexZero; v.Should().Be(65); }
public void should_write_byte() { var redisBuffer = new RedisBuffer(_64Bytes); redisBuffer.WriteByte(1, 0); redisBuffer.GetRaw()[0].Should().Be(1); }