Я пытаюсь использовать Moq для издевательства интерфейса:
public interface IMatchSetupRepository
{
IEnumerable<MatchSetup> GetAll();
}
и я делаю:
var matchSetupRepository = new Mock<IMatchSetupRepository>();
matchSetupRepository
.Setup(ms => ms.GetAll())
.Returns(null);
Но он даже не компилируется из-за ошибки:
ошибка CS0121: вызов неоднозначен между следующими способами или свойства: 'Moq.Language.IReturns < Data.Contract.IMatchSetupRepository, System.Collections.Generic.IEnumerable < Data.Model.MatchSetup → .Returns(System.Collections.Generic.IEnumerable < Data.Model.MatchSetup > )' а также "Moq.Language.IReturns < Data.Contract.IMatchSetupRepository, System.Collections.Generic.IEnumerable < Data.Model.MatchSetup → .Returns(System.Func < System.Collections.Generic.IEnumerable < Data.Model.MatchSetup → ) '
Я использую:
Moq.dll, v4.0.20926