Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPrintPartOfByteBuffer()
        public virtual void ShouldPrintPartOfByteBuffer()
        {
            ByteBuffer bytes = ByteBuffer.allocate(1024);

            for (sbyte value = 0; value < 33; value++)
            {
                bytes.put(value);
            }
            string hexString = HexPrinter.Hex(bytes, 3, 8);

            assertEquals(format("03 04 05 06 07 08 09 0A"), hexString);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldOnlyPrintBytesWrittenToBuffer()
        public virtual void ShouldOnlyPrintBytesWrittenToBuffer()
        {
            // Given
            ByteBuffer bytes = ByteBuffer.allocate(1024);

            for (sbyte value = 0; value < 10; value++)
            {
                bytes.put(value);
            }
            bytes.flip();

            // When
            string hexString = HexPrinter.Hex(bytes);

            // Then
            assertEquals(format("00 01 02 03 04 05 06 07    08 09"), hexString);
        }