Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void canDumpNeoStoreFileContent() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void CanDumpNeoStoreFileContent()
        {
            URL    neostore     = this.GetType().ClassLoader.getResource("neostore");
            string neostoreFile = neostore.File;

            DumpStore.Main(neostoreFile);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void dumpStoreShouldPrintShorterMessageForAllZeroBuffer()
        internal virtual void DumpStoreShouldPrintShorterMessageForAllZeroBuffer()
        {
            // Given
            MemoryStream       outStream = new MemoryStream();
            PrintStream        @out      = new PrintStream(outStream);
            DumpStore          dumpStore = new DumpStore(@out);
            ByteBuffer         buffer    = ByteBuffer.allocate(1024);
            AbstractBaseRecord record    = Mockito.mock(typeof(AbstractBaseRecord));

            // When
            //when( record.inUse() ).thenReturn( true );
            dumpStore.dumpHex(record, buffer, 2, 4);

            // Then
            assertEquals(format(": all zeros @ 0x8 - 0xc%n"), outStream.ToString());
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void dumpStoreShouldPrintBufferWithContent()
        internal virtual void DumpStoreShouldPrintBufferWithContent()
        {
            // Given
            MemoryStream outStream = new MemoryStream();
            PrintStream  @out      = new PrintStream(outStream);
            DumpStore    dumpStore = new DumpStore(@out);
            ByteBuffer   buffer    = ByteBuffer.allocate(1024);

            for (sbyte i = 0; i < 10; i++)
            {
                buffer.put(i);
            }
            buffer.flip();

            AbstractBaseRecord record = Mockito.mock(typeof(AbstractBaseRecord));

            // When
            //when( record.inUse() ).thenReturn( true );
            dumpStore.dumpHex(record, buffer, 2, 4);

            // Then
            assertEquals(format("@ 0x00000008: 00 01 02 03  04 05 06 07  08 09%n"), outStream.ToString());
        }