Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wang tile correction
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LABOUREL Arnaud
Wang tile correction
Commits
7eb5e873
Commit
7eb5e873
authored
3 years ago
by
LABOUREL Arnaud
Browse files
Options
Downloads
Patches
Plain Diff
Added tests for ConstrainedRotatedTruchetTileGenerator
parent
975bb864
No related branches found
No related tags found
No related merge requests found
Pipeline
#4575
passed
3 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/model/ConstrainedRotatedTruchetTileGeneratorTest.java
+38
-0
38 additions, 0 deletions
...ava/model/ConstrainedRotatedTruchetTileGeneratorTest.java
with
38 additions
and
0 deletions
src/test/java/model/ConstrainedRotatedTruchetTileGeneratorTest.java
0 → 100644
+
38
−
0
View file @
7eb5e873
package
model
;
import
javafx.scene.paint.Color
;
import
org.junit.jupiter.api.Test
;
import
java.util.Random
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
public
class
ConstrainedRotatedTruchetTileGeneratorTest
{
@Test
void
testNextTile
(){
Side
redSide
=
new
ColoredSide
(
Color
.
RED
);
Side
blueSide
=
new
ColoredSide
(
Color
.
BLUE
);
Tile
redTile
=
new
UniformTile
(
redSide
);
Square
square
=
new
ArraySquare
();
Square
northNeighbor
=
new
ArraySquare
();
Square
westNeighbor
=
new
ArraySquare
();
northNeighbor
.
put
(
redTile
);
westNeighbor
.
put
(
redTile
);
square
.
setNeighbor
(
northNeighbor
,
CardinalDirection
.
NORTH
);
square
.
setNeighbor
(
westNeighbor
,
CardinalDirection
.
WEST
);
TileGenerator
tileGenerator
=
new
ConstrainedRotatedTruchetTileGenerator
(
Color
.
BLUE
,
Color
.
RED
,
new
Random
(
0
));
for
(
int
index
=
0
;
index
<
10
;
index
++){
Tile
tile
=
tileGenerator
.
nextTile
(
square
);
assertThat
(
tile
.
side
(
CardinalDirection
.
NORTH
)).
isEqualTo
(
redSide
);
assertThat
(
tile
.
side
(
CardinalDirection
.
WEST
)).
isEqualTo
(
redSide
);
assertThat
(
tile
.
side
(
CardinalDirection
.
EAST
)).
isEqualTo
(
blueSide
);
assertThat
(
tile
.
side
(
CardinalDirection
.
SOUTH
)).
isEqualTo
(
blueSide
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment