Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
examples
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Skifjeld
examples
Commits
4099b8b5
Commit
4099b8b5
authored
7 years ago
by
Hallvard Trætteberg
Browse files
Options
Downloads
Patches
Plain Diff
Enda en test, bedrer coverage
parent
c917ab20
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tdt4140-gr1800/app.core/src/test/java/tdt4140/gr1800/app/core/LatLongTest.java
+33
-0
33 additions, 0 deletions
...re/src/test/java/tdt4140/gr1800/app/core/LatLongTest.java
with
33 additions
and
0 deletions
tdt4140-gr1800/app.core/src/test/java/tdt4140/gr1800/app/core/LatLongTest.java
0 → 100644
+
33
−
0
View file @
4099b8b5
package
tdt4140.gr1800.app.core
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LatLongTest
{
@Test
public
void
testToString
()
{
LatLong
latLong
=
new
LatLong
(
63.0
,
10.0
);
Assert
.
assertEquals
(
Double
.
toString
(
63
)
+
","
+
Double
.
toString
(
10
),
latLong
.
toString
());
}
@Test
public
void
testValueOf
()
{
testLatLong
(
LatLong
.
valueOf
(
"63.0, 10.0"
),
63.0
,
10.0
);
testLatLong
(
LatLong
.
valueOf
(
"63.0, 10.0"
,
","
),
63.0
,
10.0
);
testLatLong
(
LatLong
.
valueOf
(
"63.0; 10.0"
,
";"
),
63.0
,
10.0
);
}
private
void
testLatLong
(
LatLong
latLong
,
double
lat
,
double
lon
)
{
Assert
.
assertEquals
(
lat
,
latLong
.
latitude
,
0.0
);
Assert
.
assertEquals
(
lon
,
latLong
.
longitude
,
0.0
);
}
@Test
public
void
testEquals
()
{
Assert
.
assertTrue
(
new
LatLong
(
63.0
,
10.0
).
equals
(
new
LatLong
(
63.0
,
10.0
)));
Assert
.
assertFalse
(
new
LatLong
(
10.0
,
63.0
).
equals
(
new
LatLong
(
63.0
,
10.0
)));
Assert
.
assertFalse
(
new
LatLong
(
10.0
,
63.0
).
equals
(
null
));
Assert
.
assertFalse
(
new
LatLong
(
10.0
,
63.0
).
equals
(
"10.0, 63.0"
));
}
}
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