feature/serialize #1

Merged
manuel merged 7 commits from feature/serialize into master 2022-02-02 01:15:21 +01:00
2 changed files with 15 additions and 1 deletions
Showing only changes of commit 67c07ff2ce - Show all commits

View file

@ -2,12 +2,14 @@ package ch.fritteli.labyrinth.generator.renderer.text;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldDefaults;
@AllArgsConstructor
@EqualsAndHashCode
@FieldDefaults(level = AccessLevel.PRIVATE)
@NoArgsConstructor
@AllArgsConstructor
class CharDefinition {
//
static final String HORIZONTAL = "\u2500";

View file

@ -44,4 +44,16 @@ class CharDefinitionTest {
assertEquals("", new CharDefinition(true, true, true, false, true).toString());
assertEquals("", new CharDefinition(true, true, true, true, true).toString());
}
@Test
void testBuilderMethods() {
assertEquals(new CharDefinition(true, false, false, false, false), new CharDefinition().up());
assertEquals(new CharDefinition(false, true, false, false, false), new CharDefinition().down());
assertEquals(new CharDefinition(false, false, true, false, false), new CharDefinition().left());
assertEquals(new CharDefinition(false, false, false, true, false), new CharDefinition().right());
assertEquals(new CharDefinition(false, false, false, false, true), new CharDefinition().solution());
assertEquals(new CharDefinition(true, true, false, false, false), new CharDefinition().vertical());
assertEquals(new CharDefinition(false, false, true, true, false), new CharDefinition().horizontal());
assertEquals(new CharDefinition(true, true, true, true, true), new CharDefinition().vertical().horizontal().solution());
}
}