Compare commits

..

2 Commits

Author SHA1 Message Date
Jonathan Turner
fe89cf76af Removed JUnit Tests. 2024-02-03 15:02:30 -05:00
Jonathan Turner
36ff8d70fa Fixed javadocs 2024-02-03 15:01:21 -05:00
3 changed files with 0 additions and 136 deletions

View File

@ -122,7 +122,6 @@ public class Board {
*
* @param first the first index of the values being swapped
* @param second the second index of the values being swapped
* @return if the values were swapped or not.
*/
public void swap(int first, int second) {
int temp = this.pieces[first];

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());
}
}