Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write unit tests #29

Open
2 tasks done
Kevin-Mok opened this issue Nov 27, 2017 · 5 comments
Open
2 tasks done

Write unit tests #29

Kevin-Mok opened this issue Nov 27, 2017 · 5 comments
Assignees
Labels

Comments

@Kevin-Mok
Copy link
Owner

Kevin-Mok commented Nov 27, 2017

We only need them for 2 classes, but I think it'd be better design to have them for as many classes as we can.

  • ImageTagManager
  • TagManager

EDIT: We need more edge cases to be tested rather than just the basic ones I have written.

@Kevin-Mok
Copy link
Owner Author

Kevin-Mok commented Nov 27, 2017

I was looking into this to test our GUI/Controller. I thought it wasn't possible to build at first, but it actually just took 9 minutes to build after a couple of tries... Then, it seems to use Maven, which I'll have to look into, but I'm tired now. 😴

Maybe we'll just keep it simple and not test Controller? Even though it's our most essential and interesting class. 😑 Just not sure if we can even test it with JUnit.

@chrisshyi
Copy link
Collaborator

Feel a bit uneasy about using a library that's still in alpha.

@chrisshyi
Copy link
Collaborator

Would it be possible to construct fake GUI elements (TreeView/ListView etc) and test them with JUnit?

@Kevin-Mok
Copy link
Owner Author

Kevin-Mok commented Nov 28, 2017

I think that seems possible... 🤔 I'll see when I can find the time to try that out.

Yeah, I think I read somewhere that it being in alpha was fine (can't find it now). But, I might look into trying it out after it's due (hence the label lol).

EDIT: This TA mentions TestFX on the course forums here.

@Kevin-Mok
Copy link
Owner Author

So, it's not possible to test Controller because too many things need to be selected and clicked.

Kevin-Mok added a commit that referenced this issue Nov 29, 2017
- Will take a look at #46 another time.
- Moved the test package outside of src so that I could test package-
private methods in src.
- Auto-formatted code.
Kevin-Mok added a commit that referenced this issue Nov 30, 2017
I covered writing unit tests for all the important methods in
ImageTagManager, including private ones by calling the public method
that uses them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants