Loading app/src/main/java/com/example/a8_bitinvader/Bullet.java +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ public class Bullet extends Sprite { */ public Bullet(int xPos, int yPos, int xVel, int yVel, int screenWidth, int screenHeight, Resources res) { super(xPos, yPos, xVel, yVel, screenWidth, screenHeight); spriteImage = BitmapFactory.decodeResource(res, R.drawable.red); spriteImage = BitmapFactory.decodeResource(res, R.drawable.bullet); spriteImage = Bitmap.createScaledBitmap(spriteImage, screenWidth, screenHeight, false); } Loading app/src/test/java/com/example/a8_bitinvader/ExampleUnitTest.java +19 −2 Original line number Diff line number Diff line Loading @@ -4,14 +4,31 @@ import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * Positive number unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { /** * * @param num A number of type T * @return true iff num is greater than 0 * @param <T> A type that extends Number */ <T extends Number> boolean amIPositive(T num) { return (num.doubleValue() > 0); } @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } @Test public void testAmIPositive() { assertTrue(amIPositive(0.3)); } } Loading
app/src/main/java/com/example/a8_bitinvader/Bullet.java +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ public class Bullet extends Sprite { */ public Bullet(int xPos, int yPos, int xVel, int yVel, int screenWidth, int screenHeight, Resources res) { super(xPos, yPos, xVel, yVel, screenWidth, screenHeight); spriteImage = BitmapFactory.decodeResource(res, R.drawable.red); spriteImage = BitmapFactory.decodeResource(res, R.drawable.bullet); spriteImage = Bitmap.createScaledBitmap(spriteImage, screenWidth, screenHeight, false); } Loading
app/src/test/java/com/example/a8_bitinvader/ExampleUnitTest.java +19 −2 Original line number Diff line number Diff line Loading @@ -4,14 +4,31 @@ import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * Positive number unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { /** * * @param num A number of type T * @return true iff num is greater than 0 * @param <T> A type that extends Number */ <T extends Number> boolean amIPositive(T num) { return (num.doubleValue() > 0); } @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } @Test public void testAmIPositive() { assertTrue(amIPositive(0.3)); } }