Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Assessment2
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
Brett McAndrew
Assessment2
Merge requests
!1
Unit tests added
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Unit tests added
1-fix-assignment-errors
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Brett McAndrew
requested to merge
1-fix-assignment-errors
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Closes
#1 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
b9ff1f22
1 commit,
1 year ago
1 file
+
26
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
+
26
−
1
Options
@@ -27,5 +27,30 @@ public class DotsAndBoxesGridTest {
assertTrue
(
true
);
}
// FIXME: You need to write tests for the two known bugs in the code.
@Test
public
void
boxCompleteDetectsCompletedBoxes
()
{
// A grid where we're going to draw a box, and then test whether it's complete
DotsAndBoxesGrid
case1
=
new
DotsAndBoxesGrid
(
5
,
5
,
2
);
case1
.
drawHorizontal
(
0
,
0
,
0
);
case1
.
drawVertical
(
0
,
0
,
1
);
case1
.
drawHorizontal
(
0
,
1
,
0
);
case1
.
drawVertical
(
1
,
0
,
1
);
assertTrue
(
case1
.
boxComplete
(
0
,
0
));
assertTrue
(
case1
.
boxComplete
(
1
,
1
));
assertTrue
(
case1
.
getHorizontal
(
0
,
0
)&&
case1
.
getVertical
(
0
,
0
));
assertTrue
(
case1
.
getHorizontal
(
1
,
0
)&&
case1
.
getVertical
(
1
,
0
));
}
@Test
public
void
drawHorizontalTest
()
{
DotsAndBoxesGrid
case1
=
new
DotsAndBoxesGrid
(
5
,
5
,
2
);
case1
.
drawHorizontal
(
0
,
0
,
0
);
case1
.
drawVertical
(
0
,
0
,
1
);
case1
.
drawHorizontal
(
0
,
1
,
0
);
case1
.
drawVertical
(
1
,
0
,
1
);
assertThrows
(
RuntimeException
.
class
,
()
->
{
case1
.
drawHorizontal
(
0
,
0
,
0
);});
}
}
Loading