How do you mock a Sealed class?

前端 未结 10 2278
鱼传尺愫
鱼传尺愫 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:50

    For .NET, you could use something like TypeMock, which uses the profiling API and allows you to hook into calls to nearly anything.

提交回复
热议问题