mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/utils/TestBytesConverter.java
@Test
    public void testGetAsString()
    {
        BytesConverter bytesConverter = new BytesConverter();
        assertThat(bytesConverter.getAsString(null, null, 1023L), is("1023 B"));
        assertThat(bytesConverter.getAsString(null, null, 1024L), is("1 KB"));
        assertThat(bytesConverter.getAsString(null, null, 1023 * 1024L), is("1023 KB"));
        assertThat(bytesConverter.getAsString(null, null, 1024 * 1024L), is("1 MB"));
        assertThat(bytesConverter.getAsString(null, null, 1023 * 1024 * 1024L), is("1023 MB"));
        assertThat(bytesConverter.getAsString(null, null, 1024 * 1024 * 1024L), is("1 GB"));
        assertThat(bytesConverter.getAsString(null, null, 1023 * 1024 * 1024 * 1024L), is("1023 GB"));
        assertThat(bytesConverter.getAsString(null, null, 1024 * 1024 * 1024 * 1024L), is("1 TB"));
    }
/**
     * Test that the converter will properly convert a value to a string with the correct units.
     */
Test that the converter will properly convert a value to a string with the correct units.
Test that the converter will properly convert a value to a string with the correct units .
@Test
    public void testGetAsString()
    {
        BytesConverter bytesConverter = new BytesConverter();
        assertThat(bytesConverter.getAsString(null, null, 1023L), is("1023 B"));
        assertThat(bytesConverter.getAsString(null, null, 1024L), is("1 KB"));
        assertThat(bytesConverter.getAsString(null, null, 1023 * 1024L), is("1023 KB"));
        assertThat(bytesConverter.getAsString(null, null, 1024 * 1024L), is("1 MB"));
        assertThat(bytesConverter.getAsString(null, null, 1023 * 1024 * 1024L), is("1023 MB"));
        assertThat(bytesConverter.getAsString(null, null, 1024 * 1024 * 1024L), is("1 GB"));
        assertThat(bytesConverter.getAsString(null, null, 1023 * 1024 * 1024 * 1024L), is("1023 GB"));
        assertThat(bytesConverter.getAsString(null, null, 1024 * 1024 * 1024 * 1024L), is("1 TB"));
    }
@ Test public void testGetAsString ( ) { BytesConverter bytesConverter = new BytesConverter ( ) ; assertThat ( bytesConverter . getAsString ( null , null , 1023L ) , is ( "1023 B" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1024L ) , is ( "1 KB" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1023 * 1024L ) , is ( "1023 KB" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1024 * 1024L ) , is ( "1 MB" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1023 * 1024 * 1024L ) , is ( "1023 MB" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1024 * 1024 * 1024L ) , is ( "1 GB" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1023 * 1024 * 1024 * 1024L ) , is ( "1023 GB" ) ) ; assertThat ( bytesConverter . getAsString ( null , null , 1024 * 1024 * 1024 * 1024L ) , is ( "1 TB" ) ) ; }
Test that the converter will properly convert a value to a string with the correct units.
Test that the converter will properly convert a value to a string with the correct units .