0
我有一個需要在db工廠的類。幫助使用Moq
public class ArticleManager
{
private IDAOFactor _factory;
public ArticleManager(IDAOFactory factory)
{
this._factory = factory;
}
}
使用moq,如何創建ArticleManager的實例?
我想:
var mockFactory = new Mock<IDAOFactory>();
ArticleManager am = new ArticleManager(mockFactory);
但不是編譯。
IDAOFactory在VAR mockFactory作爲接口decalred,但我沒有看到它的任何地方聲明(除非你忽略它)。 – 2009-12-18 01:29:32