Commit 56de5630 authored by jcechace's avatar jcechace
Browse files

Fixes in tests and README

parent f5c7ba34
......@@ -114,8 +114,8 @@ Example of the file descriptors can be found in ```src/test/resources```.
In general the format is:
```text
AbilityOrSkill 5
AbilityOrSkill R
AbilityOrSkill : 5
AbilityOrSkill : R
```
Each ability or sill is placed on single line defined as combination of name and level.
......@@ -131,6 +131,7 @@ Implement the ```Character``` class with the following attributes. In order to h
| occupation | String | character's occupation |
| health | int | character's health |
| sanity | int | character's sanity |
| inventorySize | int | size of character's inventory |
| attributes | List<SkillOrAttribute> | character's attributes |
| skills | List<SkillOrAttribute> | character's skills |
......
......@@ -81,12 +81,12 @@ public class CharacterTest {
@Test
public void shouldCorrectlyParseSkills() throws URISyntaxException, IOException {
Character character = builder
.readAttributes( Paths.get(getClass().getResource("/skills_small.txt").toURI()), StandardCharsets.UTF_8)
.readSkills( Paths.get(getClass().getResource("/skills_small.txt").toURI()), StandardCharsets.UTF_8)
.build();
SoftAssertions assertions = new SoftAssertions();
assertions.assertThat(character.getAttributes()).hasSize(TEST_SKILLS.size() + 1);
assertions.assertThat(character.getAttributes()).containsAnyElementsOf(TEST_SKILLS);
assertions.assertThat(character.getAttributes()).anySatisfy(s -> assertions.assertThat(s.getName()).isEqualTo("Exam failing"));
assertions.assertThat(character.getSkills()).hasSize(TEST_SKILLS.size() + 1);
assertions.assertThat(character.getSkills()).containsAnyElementsOf(TEST_SKILLS);
assertions.assertThat(character.getSkills()).anySatisfy(s -> assertions.assertThat(s.getName()).isEqualTo("Exam failing"));
assertions.assertAll();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment