tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java in trackler-2.1.0.41 vs tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java in trackler-2.1.0.42

- old
+ new

@@ -5,10 +5,13 @@ import java.util.Arrays; import static org.junit.Assert.assertArrayEquals; +/* + * version: 1.1.0 + */ public class BaseConverterTest { /* * See https://github.com/junit-team/junit4/wiki/Rules for information on JUnit Rules in general and * ExpectedExceptions in particular. @@ -195,72 +198,72 @@ new BaseConverter(7, new int[]{0, 6, 0}); } @Ignore("Remove to run test") @Test - public void testNegativeDigit() { + public void testFirstBaseIsOne() { expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("Digits may not be negative."); + expectedException.expectMessage("Bases must be at least 2."); - new BaseConverter(2, new int[]{1, -1, 1, 0, 1, 0}); + new BaseConverter(1, new int[]{}); } @Ignore("Remove to run test") @Test - public void testInvalidPositiveDigit() { + public void testFirstBaseIsZero() { expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("All digits must be strictly less than the base."); + expectedException.expectMessage("Bases must be at least 2."); - new BaseConverter(2, new int[]{1, 2, 1, 0, 1, 0}); + new BaseConverter(0, new int[]{}); } @Ignore("Remove to run test") @Test - public void testFirstBaseIsOne() { + public void testFirstBaseIsNegative() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Bases must be at least 2."); - new BaseConverter(1, new int[]{}); + new BaseConverter(-2, new int[]{}); } @Ignore("Remove to run test") @Test - public void testSecondBaseIsOne() { - final BaseConverter baseConverter = new BaseConverter(2, new int[]{1, 0, 1, 0, 1, 0}); - + public void testNegativeDigit() { expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("Bases must be at least 2."); + expectedException.expectMessage("Digits may not be negative."); - baseConverter.convertToBase(1); + new BaseConverter(2, new int[]{1, -1, 1, 0, 1, 0}); } @Ignore("Remove to run test") @Test - public void testFirstBaseIsZero() { + public void testInvalidPositiveDigit() { expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("Bases must be at least 2."); + expectedException.expectMessage("All digits must be strictly less than the base."); - new BaseConverter(0, new int[]{}); + new BaseConverter(2, new int[]{1, 2, 1, 0, 1, 0}); } @Ignore("Remove to run test") @Test - public void testSecondBaseIsZero() { + 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(0); + baseConverter.convertToBase(1); } @Ignore("Remove to run test") @Test - public void testFirstBaseIsNegative() { + 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."); - new BaseConverter(-2, new int[]{}); + baseConverter.convertToBase(0); } @Ignore("Remove to run test") @Test public void testSecondBaseIsNegative() {