Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
3
3XA3 Lab 3 Group 7
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mike Li
3XA3 Lab 3 Group 7
Commits
8cc6311f
Commit
8cc6311f
authored
3 years ago
by
Sanjula
Browse files
Options
Downloads
Patches
Plain Diff
Update unit tests
parent
f4f80ef1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/.classpath
+1
-0
1 addition, 0 deletions
src/.classpath
src/.gitignore
+4
-0
4 additions, 0 deletions
src/.gitignore
src/settings.txt
+3
-3
3 additions, 3 deletions
src/settings.txt
src/testScore.java
+71
-0
71 additions, 0 deletions
src/testScore.java
src/testTuple.java
+46
-0
46 additions, 0 deletions
src/testTuple.java
with
125 additions
and
3 deletions
src/.classpath
+
1
−
0
View file @
8cc6311f
...
...
@@ -2,5 +2,6 @@
<classpath>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER"
/>
<classpathentry
kind=
"src"
path=
""
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.junit.JUNIT_CONTAINER/4"
/>
<classpathentry
kind=
"output"
path=
""
/>
</classpath>
This diff is collapsed.
Click to expand it.
src/.gitignore
+
4
−
0
View file @
8cc6311f
...
...
@@ -39,3 +39,7 @@
/MainMenuDisplay$2$1.class
/MainMenuDisplay$3$1.class
/ScoreDisplay$1.class
/testScore.class
/testTuple.class
/testThreadsController.class
/testGameDisplay.class
This diff is collapsed.
Click to expand it.
src/settings.txt
+
3
−
3
View file @
8cc6311f
O
ff
Constant
Infinite
O
n
Increasing
Timed
On
This diff is collapsed.
Click to expand it.
src/testScore.java
0 → 100644
+
71
−
0
View file @
8cc6311f
import
static
org
.
junit
.
Assert
.*;
import
org.junit.After
;
import
org.junit.AfterClass
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
public
class
testScore
{
Score
one
;
Score
two
;
Score
three
;
Score
four
;
@Before
public
void
setUp
()
throws
Exception
{
one
=
new
Score
(
"Obstacles | Increasing Speed | Timed | Autoreplay"
,
"3/15/2021"
,
5
);
two
=
new
Score
(
"Obstacles | Timed | Autoreplay"
,
"1/28/2021"
,
10
);
three
=
new
Score
(
"Obstacles | Increasing Speed"
,
"2/10/2021"
,
1
);
four
=
new
Score
(
"None"
,
"2/5/2021"
,
30
);
}
@After
public
void
tearDown
()
throws
Exception
{
one
=
null
;
two
=
null
;
three
=
null
;
four
=
null
;
}
@Test
public
void
testGetModes
()
{
assertEquals
(
one
.
getModes
(),
"Obstacles | Increasing Speed | Timed | Autoreplay"
);
assertEquals
(
two
.
getModes
(),
"Obstacles | Timed | Autoreplay"
);
assertEquals
(
three
.
getModes
(),
"Obstacles | Increasing Speed"
);
assertEquals
(
four
.
getModes
(),
"None"
);
}
@Test
public
void
testGetDate
()
{
assertEquals
(
one
.
getDate
(),
"3/15/2021"
);
assertEquals
(
two
.
getDate
(),
"1/28/2021"
);
assertEquals
(
three
.
getDate
(),
"2/10/2021"
);
assertEquals
(
four
.
getDate
(),
"2/5/2021"
);
}
@Test
public
void
testGetScore
()
{
assertEquals
((
int
)
one
.
getScore
(),
5
);
assertEquals
((
int
)
two
.
getScore
(),
10
);
assertEquals
((
int
)
three
.
getScore
(),
1
);
assertEquals
((
int
)
four
.
getScore
(),
30
);
}
@Test
public
void
testCompareTo
()
{
assertEquals
(
one
.
compareTo
(
two
),
1
);
assertEquals
(
two
.
compareTo
(
three
),-
1
);
assertEquals
(
three
.
compareTo
(
four
),
1
);
}
@Test
public
void
testToString
()
{
assertEquals
(
one
.
toString
(),
"Obstacles | Increasing Speed | Timed | Autoreplay,3/15/2021,5"
);
assertEquals
(
two
.
toString
(),
"Obstacles | Timed | Autoreplay,1/28/2021,10"
);
assertEquals
(
three
.
toString
(),
"Obstacles | Increasing Speed,2/10/2021,1"
);
assertEquals
(
four
.
toString
(),
"None,2/5/2021,30"
);
}
}
This diff is collapsed.
Click to expand it.
src/testTuple.java
0 → 100644
+
46
−
0
View file @
8cc6311f
import
static
org
.
junit
.
Assert
.*;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
public
class
testTuple
{
Tuple
one
;
Tuple
two
;
@Before
public
void
setUp
()
throws
Exception
{
one
=
new
Tuple
(
1
,
2
);
two
=
new
Tuple
(
100
,
100
);
}
@After
public
void
tearDown
()
throws
Exception
{
one
=
null
;
two
=
null
;
}
@Test
public
void
testChangeData
()
{
one
.
changeData
(
50
,
50
);
assertEquals
(
one
.
getX
(),
50
);
assertEquals
(
one
.
getY
(),
50
);
two
.
changeData
(
1
,
100
);
assertEquals
(
two
.
getX
(),
1
);
assertEquals
(
two
.
getY
(),
100
);
}
@Test
public
void
testGetX
()
{
assertEquals
(
one
.
getX
(),
1
);
assertEquals
(
two
.
getX
(),
100
);
}
@Test
public
void
testGetY
()
{
assertEquals
(
one
.
getY
(),
2
);
assertEquals
(
two
.
getY
(),
100
);
}
}
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