My problem is that I want to stub a property in my abstract class, because my class uses this property in the test. I am currently using the latest version of Moq.
My abstract class is as follows:
public abstract class BaseService
{
protected IDrawingSystemUow Uow { get; set; }
}
And my class in the test looks like this:
public class UserService : BaseService, IUserService
{
public bool UserExists(Model model)
{
var user = this.Uow.Users.Find(model.Id);
if(user == null) { return false; }
reurn true;
}
}
I can’t understand how I can drown the property Uow. Does anyone have a key? Or is my design so bad that I need to go to the property Uowfor my class in the test?
source
share