feature/wilson-algorithm #10
					 1 changed files with 31 additions and 2 deletions
				
			
		|  | @ -4,12 +4,41 @@ import ch.fritteli.maze.generator.model.Maze; | |||
| import ch.fritteli.maze.generator.renderer.text.TextRenderer; | ||||
| import org.junit.jupiter.api.Test; | ||||
| 
 | ||||
| import static org.assertj.core.api.Assertions.assertThat; | ||||
| 
 | ||||
| class WilsonTest { | ||||
|     @Test | ||||
|     void foo() { | ||||
|         final Maze maze = new Maze(50, 10, 0); | ||||
|         // arrange | ||||
|         final Maze maze = new Maze(10, 10, 0); | ||||
|         final Wilson wilson = new Wilson(maze); | ||||
| 
 | ||||
|         // act | ||||
|         wilson.run(); | ||||
|         System.out.println(TextRenderer.newInstance().render(maze)); | ||||
| 
 | ||||
|         // assert | ||||
|         final String textRepresentation = TextRenderer.newInstance().render(maze); | ||||
|         assertThat(textRepresentation).isEqualTo(""" | ||||
|                 ╷ ╶─────┬─────┬───┬─┐ | ||||
|                 │       │     │   │ │ | ||||
|                 │ ╷ ╶─┬─┴─┬─╴ ╵ ╷ │ │ | ||||
|                 │ │   │   │     │ │ │ | ||||
|                 │ └─┐ │ ╶─┼─┬─┬─┘ │ │ | ||||
|                 │   │ │   │ │ │   │ │ | ||||
|                 │ ╷ │ └─╴ │ ╵ ╵ ╶─┘ │ | ||||
|                 │ │ │     │         │ | ||||
|                 ├─┴─┘ ╷ ┌─┴───┐ ╷ ╶─┤ | ||||
|                 │     │ │     │ │   │ | ||||
|                 │ ╷ ┌─┘ └───╴ │ └─┬─┤ | ||||
|                 │ │ │         │   │ │ | ||||
|                 ├─┴─┘ ┌───╴ ╷ └─┐ ╵ │ | ||||
|                 │     │     │   │   │ | ||||
|                 │ ╶─┬─┴─╴ ┌─┘ ╶─┘ ╶─┤ | ||||
|                 │   │     │         │ | ||||
|                 ├─╴ ├─╴ ┌─┘ ╶─┐ ╶───┤ | ||||
|                 │   │   │     │     │ | ||||
|                 ├───┴─╴ └─┐ ╶─┴───┐ │ | ||||
|                 │         │       │ │ | ||||
|                 └─────────┴───────┘ ╵"""); | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue