How do you mock a Sealed class?

前端 未结 10 2333
鱼传尺愫
鱼传尺愫 2020-11-27 15:27

Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird.

So, What is t

10条回答
  •  星月不相逢
    2020-11-27 15:47

    Is there a way to implement a sealed class from an interface... and mock the interface instead?

    Something in me feels that having sealed classes is wrong in the first place, but that's just me :)

提交回复
热议问题