3 ms·
I think you should write a test. Naming the test just "initialise" is not very useful as it doesn't assert what you expect the method under test to do. Given t
by dcw303 9y ago
I think you should write a test.
Naming the test just "initialise" is not very useful as it doesn't assert what you expect the method under test to do. Given that the purpose of the initialise function is to populate a watchlists collection variable from the parameter, i'd name the test something like "initialise_daoRecordCountIs9_watchlistCountIs9". The pattern I generally use is <method_name>_<assertion_under_test>_<expected_result>.
Then, my test would be the following:
* Set up / mock the dao parameter to have 9 rows
* Create an instance of the class under test and push in the dao parameter
* Verify / Assert that the class under test now has 9 items in the watchlists variable - I'm assuming there is a public method to access that.