Removed JUnit Tests.

This commit is contained in:
Jonathan Turner 2024-02-03 15:02:30 -05:00
parent 36ff8d70fa
commit fe89cf76af
2 changed files with 0 additions and 135 deletions

View File

@ -1,75 +0,0 @@
package Assignments.A1.tests.Piece;
import static org.junit.Assert.*;
import Assignments.A1.models.Piece;
import org.junit.Test;
/**
* Tests the constructor for Piece.java.
*
* @author Jonathan Turner
* @version Spring 2024
*/
public class TestConstructor {
@Test
public void testZeroValue() {
assertThrows(IllegalArgumentException.class, () -> {
new Piece(5, 0);
});
}
@Test
public void testOneValue() {
Piece test = new Piece(5, 1);
assertEquals(1, test.getValue());
}
@Test
public void testEightValue() {
Piece test = new Piece(5, 8);
assertEquals(8, test.getValue());
}
@Test
public void testNineValue() {
assertThrows(IllegalArgumentException.class, () -> {
new Piece(5, 9);
});
}
@Test
public void testNegativeLoc() {
assertThrows(IllegalArgumentException.class, () -> {
new Piece(-1, 5);
});
}
@Test
public void testZeroLoc() {
Piece test = new Piece(0, 5);
assertEquals(0, test.getLoc());
}
@Test
public void testEightLoc() {
Piece test = new Piece(8, 5);
assertEquals(8, test.getLoc());
}
@Test
public void testNineLoc() {
assertThrows(IllegalArgumentException.class, () -> {
new Piece(9, 5);
});
}
@Test
public void validParams() {
Piece test = new Piece(3, 6);
assertEquals(3, test.getLoc());
assertEquals(6, test.getValue());
}
}

View File

@ -1,60 +0,0 @@
package Assignments.A1.tests.Piece;
import static org.junit.Assert.*;
import Assignments.A1.models.Piece;
import org.junit.Test;
/**
* Tests the moveTo() for Piece.java.
*
* @author Jonathan Turner
* @version Spring 2024
*/
public class TestMoveTo {
@Test
public void testNegativeMove() {
Piece test = new Piece(3, 5);
assertThrows(IllegalArgumentException.class, () -> {
test.moveTo(-1);
});
}
@Test
public void testZeroMove() {
Piece test = new Piece(3, 5);
test.moveTo(0);
assertEquals(0, test.getLoc());
}
@Test
public void testEightMove() {
Piece test = new Piece(5, 5);
test.moveTo(8);
assertEquals(8, test.getLoc());
}
@Test
public void testNineMove() {
Piece test = new Piece(3, 5);
assertThrows(IllegalArgumentException.class, () -> {
test.moveTo(9);
});
}
@Test
public void MoveToSameLocation() {
Piece test = new Piece(3, 5);
assertThrows(IllegalArgumentException.class, () -> {
test.moveTo(3);
});
}
@Test
public void ValidMove() {
Piece test = new Piece(3, 5);
test.moveTo(4);
assertEquals(4, test.getLoc());
}
}