I have the following so far which I am trying to unit test:
private Mock<IDBFactory> _mockDbFactory;
private IArticleManager _articleManager;
[Setup]
public Setup()
{
_mockDbFactory = new Mock<IDBFactory>();
_articleManager = new ArticleManager(_mockDbFactory);
}
[Test]
public void load_article_by_title()
{
string title = "sometitle";
// _dbFactory.GetArticleDao().GetByTitle(title); <!-- need to mock this
_mockDBFactory.Setup(x => x.GetArticleDao().GetByTitle(It.IsAny<string>()));
_articleManager.LoadArticle(title);
Assert.IsNotNull(_articleManager.Article);
}
I get the error:
Invalid setup of a non-overridable member: