public void should_be_instanced() { var redisBuffer = new RedisBuffer(_64Bytes); redisBuffer.Should().NotBeNull(); var raw = redisBuffer.GetRaw(); raw.Length.Should().Be(_64Bytes); raw.Should().NotContain(v => v != 0); var otherRaw = redisBuffer.GetRaw(); ReferenceEquals(raw, otherRaw).Should().BeTrue(); }
public void should_be_copy_from_array_of_bytes() { var redisBuffer = new RedisBuffer(_64Bytes); var arr = new byte[_64Bytes]; for (byte i = 0; i < _64Bytes; i++) arr[i] = i; redisBuffer.CopyFrom(arr, 0, 0, _64Bytes); byte[] raw = redisBuffer.GetRaw(); raw.Should().BeEquivalentTo(arr); }
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 void should_write_byte() { var redisBuffer = new RedisBuffer(_64Bytes); redisBuffer.WriteByte(1, 0); redisBuffer.GetRaw()[0].Should().Be(1); }