Writing a single unit test for multiple implementations of an interface

后端 未结 7 1712
感动是毒
感动是毒 2020-12-23 11:26

I have an interface List whose implementations include Singly Linked List, Doubly, Circular etc. The unit tests I wrote for Singly should do good for most of Do

7条回答
  •  被撕碎了的回忆
    2020-12-23 11:51

    You could actually create a helper method in your test class that sets up your test List to be an instance of one of your implementations dependent on an argument. In combination with this you should be able to get the behaviour you want.

提交回复
热议问题