Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Stazione dei treni
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Francesco Fontana
Stazione dei treni
Commits
e0ccf6b2
Commit
e0ccf6b2
authored
Jul 20, 2023
by
Francesco Fontana
Browse files
Options
Downloads
Patches
Plain Diff
VERDE: testToString di TestTreno.java supera il test
parent
5cc55818
Branches
feature/Model
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/it/unimi/di/sweng/esame/model/Treno.java
+1
-5
1 addition, 5 deletions
src/main/java/it/unimi/di/sweng/esame/model/Treno.java
src/test/java/TestTreno.java
+19
-0
19 additions, 0 deletions
src/test/java/TestTreno.java
with
20 additions
and
5 deletions
src/main/java/it/unimi/di/sweng/esame/model/Treno.java
+
1
−
5
View file @
e0ccf6b2
...
...
@@ -53,11 +53,7 @@ public final class Treno {
@Override
public
String
toString
()
{
return
"Treno["
+
"codice="
+
codice
+
", "
+
"destinazione="
+
destinazione
+
", "
+
"orario="
+
orario
+
", "
+
"ritardo="
+
ritardo
+
']'
;
return
codice
+
" "
+
destinazione
+
" "
+
orario
+
" "
+
ritardo
.
toMinutes
();
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/test/java/TestTreno.java
0 → 100644
+
19
−
0
View file @
e0ccf6b2
import
it.unimi.di.sweng.esame.model.Treno
;
import
org.junit.jupiter.api.Test
;
import
java.time.Duration
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
public
class
TestTreno
{
@Test
void
testToString
()
{
Treno
t
=
new
Treno
(
"NTV 3312"
,
"ROMA"
,
LocalTime
.
parse
(
"14:00"
,
DateTimeFormatter
.
ofPattern
(
"H:m"
)),
Duration
.
ofMinutes
(
15
));
assertThat
(
t
.
toString
()).
isEqualTo
(
"NTV 3312 ROMA 14:00 15"
);
}
}
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