Searching for Dan
You search Soda for Dan and finally find him in the basements of Soda.
[Dan]
Oh hello student! Need some help with Gitlet?
...
No? Oh then how's it going.
...
Oh so you met Chantine and she's kinda weird and cryptic but a pretty cool person nonetheless.
...
Uh she asked me to meet her where "three colors collide"? I really have no idea what that means...
...
What do you mean I need to merge with Daniel...
...
We used to be one? ummmmmmm I'm pretty sure I'm me and I've always been me.
Are you okay friend? I mean Gitlet still isn't due for a bit.
You hear a eerie voice float into your ear \~Drat! it's been so long that he's forgotten who he truly is. You must do your best to convince him to meet me and hopefully I can restore his memories.\~
[Dan]
Well student, it seems like your a bit out of luck since even if I did want to go with you, I still have all these autograder tests to write.
...
Oh you're willing to help? Wait isn't that cheating...
...
Ehh well I am running short on time and maybe if we finish quickly I can check out what you're so worked up about.
Writing The Autograder
Alright so as you know, we just finished the CubePuzzle
project. I still got a couple more autograder tests to write and the one I'm working on right now is the one that tests initPuzzle
. You remember how that works right? If not I'm sure you can check back to how your code works.
I already have some of the code written down and if you could maybe complete it for me, that'd be great.
import cube.CubeModel;
import cube.Main;
import org.junit.Test;
import static org.junit.Assert.*;
public class AGTestCubeModel {
@___________
public void testInitPuzzle() {
Main main = new Main();
CubeModel model = main._model;
__________________________________________________________;
int paintedCount = 0;
for (_______________________________________) {
for (_______________________________________) {
if (_______________________________________) {
______________________________________________;
}
}
}
__________________________________________________________;
__________________________________________________________;
__________________________________________________________;
}
}
Huh? Oh I guess you're right _model
in CubeModel
is technically private... let's just assume that's public
for now. Check back with me when you're done.
Instructions
Fill in the blanks above to write a valid JUnit test that checks if initPuzzle
works properly. For initPuzzle
to work properly, it needs to make sure that the puzzle's board has six squares shaded and that the cube is placed within bounds.
You cannot access any private instance variables other than the _model
in CubeModel
. As a hint, take a look at the methods you had to define for the project. Write out your solution code on a separate sheet of paper, once you're done, show it to the TA at your station and they will give you the code word.