tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java in trackler-2.2.1.137 vs tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java in trackler-2.2.1.138
- old
+ new
@@ -12,14 +12,14 @@
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Test
public void testSingleBitOneToDecimal() {
- final BaseConverter baseConverter = new BaseConverter(2, new int[]{1});
+ BaseConverter baseConverter = new BaseConverter(2, new int[]{1});
- final int[] expectedDigits = new int[]{1};
- final int[] actualDigits = baseConverter.convertToBase(10);
+ int[] expectedDigits = new int[]{1};
+ int[] actualDigits = baseConverter.convertToBase(10);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -29,14 +29,14 @@
}
@Ignore("Remove to run test")
@Test
public void testBinaryToSingleDecimal() {
- final BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1});
+ BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1});
- final int[] expectedDigits = new int[]{5};
- final int[] actualDigits = baseConverter.convertToBase(10);
+ int[] expectedDigits = new int[]{5};
+ int[] actualDigits = baseConverter.convertToBase(10);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -46,14 +46,14 @@
}
@Ignore("Remove to run test")
@Test
public void testSingleDecimalToBinary() {
- final BaseConverter baseConverter = new BaseConverter(10, new int[]{5});
+ BaseConverter baseConverter = new BaseConverter(10, new int[]{5});
- final int[] expectedDigits = new int[]{1, 0, 1};
- final int[] actualDigits = baseConverter.convertToBase(2);
+ int[] expectedDigits = new int[]{1, 0, 1};
+ int[] actualDigits = baseConverter.convertToBase(2);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -63,14 +63,14 @@
}
@Ignore("Remove to run test")
@Test
public void testBinaryToMultipleDecimal() {
- final BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1, 0, 1, 0});
+ BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1, 0, 1, 0});
- final int[] expectedDigits = new int[]{4, 2};
- final int[] actualDigits = baseConverter.convertToBase(10);
+ int[] expectedDigits = new int[]{4, 2};
+ int[] actualDigits = baseConverter.convertToBase(10);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -80,14 +80,14 @@
}
@Ignore("Remove to run test")
@Test
public void testDecimalToBinary() {
- final BaseConverter baseConverter = new BaseConverter(10, new int[]{4, 2});
+ BaseConverter baseConverter = new BaseConverter(10, new int[]{4, 2});
- final int[] expectedDigits = new int[]{1, 0, 1, 0, 1, 0};
- final int[] actualDigits = baseConverter.convertToBase(2);
+ int[] expectedDigits = new int[]{1, 0, 1, 0, 1, 0};
+ int[] actualDigits = baseConverter.convertToBase(2);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -97,14 +97,14 @@
}
@Ignore("Remove to run test")
@Test
public void testTrinaryToHexadecimal() {
- final BaseConverter baseConverter = new BaseConverter(3, new int[]{1, 1, 2, 0});
+ BaseConverter baseConverter = new BaseConverter(3, new int[]{1, 1, 2, 0});
- final int[] expectedDigits = new int[]{2, 10};
- final int[] actualDigits = baseConverter.convertToBase(16);
+ int[] expectedDigits = new int[]{2, 10};
+ int[] actualDigits = baseConverter.convertToBase(16);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -114,14 +114,14 @@
}
@Ignore("Remove to run test")
@Test
public void testHexadecimalToTrinary() {
- final BaseConverter baseConverter = new BaseConverter(16, new int[]{2, 10});
+ BaseConverter baseConverter = new BaseConverter(16, new int[]{2, 10});
- final int[] expectedDigits = new int[]{1, 1, 2, 0};
- final int[] actualDigits = baseConverter.convertToBase(3);
+ int[] expectedDigits = new int[]{1, 1, 2, 0};
+ int[] actualDigits = baseConverter.convertToBase(3);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -131,14 +131,14 @@
}
@Ignore("Remove to run test")
@Test
public void test15BitInteger() {
- final BaseConverter baseConverter = new BaseConverter(97, new int[]{3, 46, 60});
+ BaseConverter baseConverter = new BaseConverter(97, new int[]{3, 46, 60});
- final int[] expectedDigits = new int[]{6, 10, 45};
- final int[] actualDigits = baseConverter.convertToBase(73);
+ int[] expectedDigits = new int[]{6, 10, 45};
+ int[] actualDigits = baseConverter.convertToBase(73);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -148,14 +148,14 @@
}
@Ignore("Remove to run test")
@Test
public void testEmptyDigits() {
- final BaseConverter baseConverter = new BaseConverter(2, new int[]{});
+ BaseConverter baseConverter = new BaseConverter(2, new int[]{});
- final int[] expectedDigits = new int[]{0};
- final int[] actualDigits = baseConverter.convertToBase(10);
+ int[] expectedDigits = new int[]{0};
+ int[] actualDigits = baseConverter.convertToBase(10);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -165,14 +165,14 @@
}
@Ignore("Remove to run test")
@Test
public void testSingleZero() {
- final BaseConverter baseConverter = new BaseConverter(10, new int[]{0});
+ BaseConverter baseConverter = new BaseConverter(10, new int[]{0});
- final int[] expectedDigits = new int[]{0};
- final int[] actualDigits = baseConverter.convertToBase(2);
+ int[] expectedDigits = new int[]{0};
+ int[] actualDigits = baseConverter.convertToBase(2);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -182,14 +182,14 @@
}
@Ignore("Remove to run test")
@Test
public void testMultipleZeros() {
- final BaseConverter baseConverter = new BaseConverter(10, new int[]{0, 0, 0});
+ BaseConverter baseConverter = new BaseConverter(10, new int[]{0, 0, 0});
- final int[] expectedDigits = new int[]{0};
- final int[] actualDigits = baseConverter.convertToBase(2);
+ int[] expectedDigits = new int[]{0};
+ int[] actualDigits = baseConverter.convertToBase(2);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -199,14 +199,14 @@
}
@Ignore("Remove to run test")
@Test
public void testLeadingZeros() {
- final BaseConverter baseConverter = new BaseConverter(7, new int[]{0, 6, 0});
+ BaseConverter baseConverter = new BaseConverter(7, new int[]{0, 6, 0});
- final int[] expectedDigits = new int[]{4, 2};
- final int[] actualDigits = baseConverter.convertToBase(10);
+ int[] expectedDigits = new int[]{4, 2};
+ int[] actualDigits = baseConverter.convertToBase(10);
assertArrayEquals(
String.format(
"Expected digits: %s but found digits: %s",
Arrays.toString(expectedDigits),
@@ -261,32 +261,32 @@
}
@Ignore("Remove to run test")
@Test
public void testSecondBaseIsOne() {
- final BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1, 0, 1, 0});
+ BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1, 0, 1, 0});
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Bases must be at least 2.");
baseConverter.convertToBase(1);
}
@Ignore("Remove to run test")
@Test
public void testSecondBaseIsZero() {
- final BaseConverter baseConverter = new BaseConverter(10, new int[]{7});
+ BaseConverter baseConverter = new BaseConverter(10, new int[]{7});
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Bases must be at least 2.");
baseConverter.convertToBase(0);
}
@Ignore("Remove to run test")
@Test
public void testSecondBaseIsNegative() {
- final BaseConverter baseConverter = new BaseConverter(2, new int[]{1});
+ BaseConverter baseConverter = new BaseConverter(2, new int[]{1});
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Bases must be at least 2.");
baseConverter.convertToBase(-7);