How to moq a static class with a static method (UnitOfWork case)?

后端 未结 4 2061
無奈伤痛
無奈伤痛 2021-02-08 02:10

I have these classes:

public static class UnitOfWorkSS 
{
  public static IUnitOfWork Begin()
  {
    return IoC.Resolve();
  }
}

public clas         


        
4条回答
  •  情话喂你
    2021-02-08 02:52

    Mock the IUnitOfWork and register it into your container so that it can be resolved.

提交回复
热议问题