Add unit test for setDependency

Add some unit tests for setDependency with one and two dependencies. Test
verifies notification are triggered properly.