tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java in trackler-2.0.6.2 vs tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java in trackler-2.0.6.3
- old
+ new
@@ -1,5 +1,6 @@
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.util.Arrays;
@@ -29,10 +30,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testBinaryToSingleDecimal() {
final BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1});
final int[] expectedDigits = new int[]{5};
@@ -45,10 +47,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testSingleDecimalToBinary() {
final BaseConverter baseConverter = new BaseConverter(10, new int[]{5});
final int[] expectedDigits = new int[]{1, 0, 1};
@@ -61,10 +64,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testBinaryToMultipleDecimal() {
final BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1, 0, 1, 0});
final int[] expectedDigits = new int[]{4, 2};
@@ -77,10 +81,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testDecimalToBinary() {
final BaseConverter baseConverter = new BaseConverter(10, new int[]{4, 2});
final int[] expectedDigits = new int[]{1, 0, 1, 0, 1, 0};
@@ -93,10 +98,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testTrinaryToHexadecimal() {
final BaseConverter baseConverter = new BaseConverter(3, new int[]{1, 1, 2, 0});
final int[] expectedDigits = new int[]{2, 10};
@@ -109,10 +115,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testHexadecimalToTrinary() {
final BaseConverter baseConverter = new BaseConverter(16, new int[]{2, 10});
final int[] expectedDigits = new int[]{1, 1, 2, 0};
@@ -125,10 +132,11 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void test15BitInteger() {
final BaseConverter baseConverter = new BaseConverter(97, new int[]{3, 46, 60});
final int[] expectedDigits = new int[]{6, 10, 45};
@@ -141,18 +149,20 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testEmptyDigits() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("You must supply at least one digit.");
new BaseConverter(2, new int[]{});
}
+ @Ignore
@Test
public void testSingleZero() {
final BaseConverter baseConverter = new BaseConverter(10, new int[]{0});
final int[] expectedDigits = new int[]{0};
@@ -165,85 +175,95 @@
Arrays.toString(actualDigits)),
expectedDigits,
actualDigits);
}
+ @Ignore
@Test
public void testMultipleZeros() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Digits may not contain leading zeros.");
new BaseConverter(10, new int[]{0, 0, 0});
}
+ @Ignore
@Test
public void testLeadingZeros() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Digits may not contain leading zeros.");
new BaseConverter(7, new int[]{0, 6, 0});
}
+ @Ignore
@Test
public void testNegativeDigit() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Digits may not be negative.");
new BaseConverter(2, new int[]{1, -1, 1, 0, 1, 0});
}
+ @Ignore
@Test
public void testInvalidPositiveDigit() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("All digits must be strictly less than the base.");
new BaseConverter(2, new int[]{1, 2, 1, 0, 1, 0});
}
+ @Ignore
@Test
public void testFirstBaseIsOne() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Bases must be at least 2.");
new BaseConverter(1, new int[]{});
}
+ @Ignore
@Test
public void testSecondBaseIsOne() {
final 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
@Test
public void testFirstBaseIsZero() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Bases must be at least 2.");
new BaseConverter(0, new int[]{});
}
+ @Ignore
@Test
public void testSecondBaseIsZero() {
final 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(0);
}
+ @Ignore
@Test
public void testFirstBaseIsNegative() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("Bases must be at least 2.");
new BaseConverter(-2, new int[]{});
}
+ @Ignore
@Test
public void testSecondBaseIsNegative() {
final BaseConverter baseConverter = new BaseConverter(2, new int[]{1});
expectedException.expect(IllegalArgumentException.class);