Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
COSC220-S220191487-SD2
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
Model registry
Operate
Environments
Terraform modules
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
abryce2
COSC220-S220191487-SD2
Commits
fb19c627
Commit
fb19c627
authored
3 years ago
by
abryce2
Browse files
Options
Downloads
Patches
Plain Diff
Added unit testing
parent
755d4746
No related branches found
No related tags found
No related merge requests found
Pipeline
#1337
failed
3 years ago
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
+32
-1
32 additions, 1 deletion
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
with
32 additions
and
1 deletion
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
+
32
−
1
View file @
fb19c627
...
...
@@ -27,5 +27,36 @@ public class DotsAndBoxesGridTest {
assertTrue
(
true
);
}
// FIXME: You need to write tests for the two known bugs in the code.
@Test
public
void
testBoxComplete
()
{
logger
.
info
(
"Test to show that box complete runs correctly"
);
DotsAndBoxesGrid
DaB
=
new
DotsAndBoxesGrid
(
10
,
10
,
1
);
Assertions
.
assertEquals
(
false
,
DaB
.
boxComplete
(
4
,
3
));
}
@Test
public
void
testdrawHorizontal
()
{
logger
.
info
(
"Test to show horizontal lines can only be draw once in the same place"
);
DotsAndBoxesGrid
DaB
=
new
DotsAndBoxesGrid
(
10
,
10
,
1
);
DaB
.
drawHorizontal
(
4
,
2
,
1
);
Assertions
.
assertThrows
(
IllegalStateException
.
class
,
()
->
{
DaB
.
drawHorizontal
(
4
,
2
,
1
);
},
"There is already a horizontal line here. "
);
}
@Test
public
void
testdrawVertical
()
{
logger
.
info
(
"Test to show vertical lines can only be draw once in the same place"
);
DotsAndBoxesGrid
DaB
=
new
DotsAndBoxesGrid
(
10
,
10
,
1
);
DaB
.
drawVertical
(
4
,
2
,
1
);
Assertions
.
assertThrows
(
IllegalStateException
.
class
,
()
->
{
DaB
.
drawVertical
(
4
,
2
,
1
);
},
"There is already a vertical line here. "
);
}
}
// FIXME: You need to write tests for the two known bugs in the code.
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