-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFacadeTest.java
More file actions
35 lines (26 loc) · 931 Bytes
/
Copy pathFacadeTest.java
File metadata and controls
35 lines (26 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package structural.facade;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
public class FacadeTest {
private CharacterService service;
@Before
public void setUp() {
service = new CharacterService();
}
@Test
public void createCharacter_Should_Create_Character() {
Character fairy = service.createCharacter("Fairy", 50);
assertThat(fairy, instanceOf(Fairy.class));
}
@Test
public void transfer_Should_Transfer_Resources_Between_Character() {
Character fairy = service.createCharacter("Fairy", 50);
Character warrior = service.createCharacter("Warrior", 50);
service.transfer(fairy, warrior, 50);
assertEquals(fairy.getQuantity(), 0);
assertEquals(warrior.getQuantity(), 100);
}
}