jameshughes89 / cs102

CS 102: Data Structures --- Java
http://csci162.com/
GNU General Public License v3.0
11 stars 16 forks source link

:lipstick: :technologist: Equals tests --- Make use of `of` method #953

Closed jameshughes89 closed 8 months ago

jameshughes89 commented 8 months ago

Related Issues or PRs

Closes #830

What

  1. Create of factory methods to create the instances of the classes to check equality on
  2. Use the factory methods when creating the instances

Why

Much cleaner

Testing

:+1:

Additional Notes

The ArrayQueueEqualsTest still does create a few instances without an of since they were peculiar and it didn't really make sense to make a method for these special cases. Specifically, the tests where the front of the queue is not at index 0 and when the queue's data loops back on the array.