Exemplo n.º 1
0
        public void Test_Int(ByteOrder byteOrder, int index, int input)
        {
            var buffer = new ExpandableArrayBuffer();

            buffer.PutInt(index, input, byteOrder);

            var result = (byteOrder == ExpandableArrayBuffer.NATIVE_BYTE_ORDER) ? buffer.GetInt(index) : buffer.GetInt(index, byteOrder);

            Assert.AreEqual(input, result);
        }
Exemplo n.º 2
0
        public void ShouldExpand()
        {
            IMutableDirectBuffer buffer = new ExpandableArrayBuffer();

            int capacity = buffer.Capacity;

            int index = capacity + 50;
            int value = 777;

            buffer.PutInt(index, value);

            Assert.That(buffer.Capacity, Is.GreaterThan(capacity));
            Assert.AreEqual(buffer.GetInt(index), value);
        }
Exemplo n.º 3
0
        public void Test_Int(ByteOrder byteOrder, byte[] expectedResult, int index, int input)
        {
            var buffer = new ExpandableArrayBuffer();

            buffer.PutInt(index, input, byteOrder);

            var expectedResultArray = new ExpandableArrayBuffer();

            expectedResultArray.PutBytes(index, expectedResult);

            Assert.AreEqual(expectedResultArray, buffer);

            var result = (byteOrder == ExpandableArrayBuffer.NATIVE_BYTE_ORDER) ? buffer.GetInt(index) : buffer.GetInt(index, byteOrder);

            Assert.AreEqual(result, input);
        }