Hi guys, one of my repository class (say PersonRepo) has a delegate as its property something like this
private readonly Func<INameRepo> _nameRepo;
and apart from this it is inherited by a class which itself expects one more object (say the session).
Thus when i intialize this in my test I do something like
var funcNameRepo=autoMock.Mock<Func<INameRepo>>();
_personRepo= new PersonRepo(session,funcNameRepo.Object);
but when i run this test i get the following error:
Unable to cast object of type 'System.Func`1[Repositories.Interfaces.INameRepo]' to type Moq.IMocked`1[System.Func`1[Repositories.Interfaces.INameRepo]]'.
what do you think I am doing wrong here. please help me.