Skip to content

Commit 623f6be

Browse files
committed
add small test to assert that neutral is not an enemy
1 parent abb0e17 commit 623f6be

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package bwapi;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.assertFalse;
6+
import static org.mockito.Mockito.mock;
7+
import static org.mockito.Mockito.when;
8+
9+
public class PlayerTest {
10+
11+
@Test
12+
public void neutralIsNotEnemy() {
13+
Player neutral = mock(Player.class);
14+
Player self = mock(Player.class);
15+
16+
when(neutral.isNeutral()).thenReturn(true);
17+
when(self.isEnemy(neutral)).thenCallRealMethod();
18+
19+
assertFalse(self.isEnemy(neutral));
20+
}
21+
}

0 commit comments

Comments
 (0)