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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brett McAndrew
Assessment2
Compare revisions
f4cc147e7ae650aee325a54f0a2ba4624dcc9218 to 9e7607fa2e13259b15385726baf74bd1058399d7
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
bmcandre/assessment2
Select target project
No results found
9e7607fa2e13259b15385726baf74bd1058399d7
Select Git revision
Loading items
Swap
Target
bmcandre/assessment2
Select target project
bmcandre/assessment2
1 result
f4cc147e7ae650aee325a54f0a2ba4624dcc9218
Select Git revision
Loading items
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
2
Unit tests added
· b9ff1f22
Brett McAndrew
authored
Aug 2, 2023
b9ff1f22
Merge branch '1-fix-assignment-errors' into 'main'
· 9e7607fa
Brett McAndrew
authored
Aug 2, 2023
Unit tests added Closes
#1
See merge request
!1
9e7607fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
+26
-1
26 additions, 1 deletion
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
with
26 additions
and
1 deletion
src/test/java/dotsandboxes/DotsAndBoxesGridTest.java
View file @
9e7607fa
...
...
@@ -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
);});
}
}
This diff is collapsed.
Click to expand it.