mirror of
https://github.com/FatttSnake/OxygenToolbox.git
synced 2026-04-06 11:01:26 +08:00
Add tool Base Converter.
This commit is contained in:
14
app/src/test/java/com/fatapp/oxygentoolbox/MethodTest.java
Normal file
14
app/src/test/java/com/fatapp/oxygentoolbox/MethodTest.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.fatapp.oxygentoolbox;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import com.fatapp.oxygentoolbox.util.HexConversionUtils;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class MethodTest {
|
||||
@Test
|
||||
public void decimalToBaseTest() {
|
||||
assertEquals(HexConversionUtils.decimalToBase("2.2", 2), "10.00110011001100110011001100110011001100110011001100");
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,21 @@
|
||||
package com.fatapp.oxygentoolbox;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class Tester {
|
||||
public class TempTest {
|
||||
@Test
|
||||
public void urlEncodeTest() throws UnsupportedEncodingException {
|
||||
System.out.println(URLEncoder.encode(" ", StandardCharsets.UTF_8.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hexTest() {
|
||||
assertEquals(Integer.parseInt("a", 36), 10);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user