How do you unit test an interface?

后端 未结 5 1706
忘掉有多难
忘掉有多难 2020-12-13 13:37

For example, there is a interface IMyInterface, and three classes support this interface:

class A : IMyInterface
{
}

class B : IMyInterface
{
}         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 14:14

    Could create methods that take a parameter of type IMyInterface and have the actual test methods just call those methods passing in different concrete classes.

提交回复
热议问题