Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wang tile template
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 template
Commits
5c7b89a3
Commit
5c7b89a3
authored
Oct 5, 2021
by
LABOUREL Arnaud
Browse files
Options
Downloads
Patches
Plain Diff
changement hamcrest -> assertJ pour les tests
parent
e70fd64e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.gradle
+3
-3
3 additions, 3 deletions
build.gradle
src/test/java/ByteGrayColorTest.java
+6
-7
6 additions, 7 deletions
src/test/java/ByteGrayColorTest.java
src/test/java/MatrixGrayImageTest.java
+7
-9
7 additions, 9 deletions
src/test/java/MatrixGrayImageTest.java
with
16 additions
and
19 deletions
build.gradle
+
3
−
3
View file @
5c7b89a3
...
...
@@ -13,9 +13,9 @@ repositories {
}
dependencies
{
testImplementation
(
'org.junit.jupiter:junit-jupiter-api:5.
7.2
'
,
'org.
hamcrest:hamcrest-library:2.2'
,
'net.obvj:junit-utils:1.3.1
'
)
testRuntimeOnly
'org.junit.jupiter:junit-jupiter-engine:5.
7.2'
testImplementation
(
'org.junit.jupiter:junit-jupiter-api:5.
8.1
'
,
'org.
assertj:assertj-core:3.21.0
'
)
testRuntimeOnly
(
'org.junit.jupiter:junit-jupiter-engine:5.
8.1'
)
}
test
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/ByteGrayColorTest.java
+
6
−
7
View file @
5c7b89a3
import
org.junit.jupiter.api.Test
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
public
class
ByteGrayColorTest
{
@Test
public
void
testGetLuminosity_whenColorCreatedWithGrayLevel
(){
ByteGrayColor
black
=
new
ByteGrayColor
(
0
);
ByteGrayColor
white
=
new
ByteGrayColor
(
255
);
assertThat
(
black
.
getLuminosity
()
,
is
(
c
loseTo
(
0
.,
.
0001
)
));
assertThat
(
white
.
getLuminosity
()
,
is
(
c
loseTo
(
1
.,
.
0001
)
));
assertThat
(
black
.
getLuminosity
()
).
isC
loseTo
(
0
.,
within
(.
01
));
assertThat
(
white
.
getLuminosity
()
).
isC
loseTo
(
1
.,
within
(.
01
));
}
@Test
public
void
testGetLuminosity_whenColorCreatedWithLuminosity
(){
ByteGrayColor
color1
=
new
ByteGrayColor
(.
25
);
ByteGrayColor
color2
=
new
ByteGrayColor
(.
75
);
assertThat
(
color1
.
getLuminosity
()
,
is
(
c
loseTo
(.
25
,
.
0001
)
));
assertThat
(
color2
.
getLuminosity
()
,
is
(
c
loseTo
(.
75
,
.
0001
)
));
assertThat
(
color1
.
getLuminosity
()
).
isC
loseTo
(.
25
,
within
(.
01
));
assertThat
(
color2
.
getLuminosity
()
).
isC
loseTo
(.
75
,
within
(.
01
));
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test/java/MatrixGrayImageTest.java
+
7
−
9
View file @
5c7b89a3
import
org.junit.jupiter.api.Test
;
import
static
org
.
hamcrest
.
MatcherAssert
.
assertThat
;
import
static
org
.
hamcrest
.
Matchers
.*;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
class
MatrixGrayImageTest
{
@Test
void
getWidth
()
{
assertThat
(
new
MatrixGrayImage
(
0
,
0
).
getWidth
()
,
is
(
e
qualTo
(
0
)
))
;
assertThat
(
new
MatrixGrayImage
(
10
,
20
).
getWidth
()
,
is
(
e
qualTo
(
10
)
))
;
assertThat
(
new
MatrixGrayImage
(
400
,
300
).
getWidth
()
,
is
(
e
qualTo
(
400
)
))
;
assertThat
(
new
MatrixGrayImage
(
0
,
0
).
getWidth
()
).
isE
qualTo
(
0
);
assertThat
(
new
MatrixGrayImage
(
10
,
20
).
getWidth
()
).
isE
qualTo
(
10
);
assertThat
(
new
MatrixGrayImage
(
400
,
300
).
getWidth
()
).
isE
qualTo
(
400
);
}
@Test
void
getHeight
()
{
assertThat
(
new
MatrixGrayImage
(
0
,
0
).
get
Width
(),
is
(
e
qualTo
(
0
)
))
;
assertThat
(
new
MatrixGrayImage
(
10
,
20
).
get
Width
(),
is
(
e
qualTo
(
20
)
))
;
assertThat
(
new
MatrixGrayImage
(
400
,
300
).
get
Width
(),
is
(
e
qualTo
(
300
)
))
;
assertThat
(
new
MatrixGrayImage
(
0
,
0
).
get
Height
()).
isE
qualTo
(
0
);
assertThat
(
new
MatrixGrayImage
(
10
,
20
).
get
Height
()).
isE
qualTo
(
20
);
assertThat
(
new
MatrixGrayImage
(
400
,
300
).
get
Height
()).
isE
qualTo
(
300
);
}
}
\ No newline at end of file
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