Estoy intentando utilizar Moq para burlarse de la interfaz:método de instalación en Moq, llamada ambigua
public interface IMatchSetupRepository
{
IEnumerable<MatchSetup> GetAll();
}
y estoy haciendo:
var matchSetupRepository = new Mock<IMatchSetupRepository>();
matchSetupRepository
.Setup(ms => ms.GetAll())
.Returns(null);
Pero ni siquiera compilar porque del error:
error CS0121: The call is ambiguous between the following methods or properties: 'Moq.Language.IReturns<Data.Contract.IMatchSetupRepository,System.Collections.Generic.IEnumerable<Data.Model.MatchSetup>>.Returns(System.Collections.Generic.IEnumerable<Data.Model.MatchSetup>)' and 'Moq.Language.IReturns<Data.Contract.IMatchSetupRepository,System.Collections.Generic.IEnumerable<Data.Model.MatchSetup>>.Returns(System.Func<System.Collections.Generic.IEnumerable<Data.Model.MatchSetup>>)'
que estoy usando:
Moq.dll, v4.0.20926
dohh .. gracias hombre !! ¡lo tengo! – user1082693
¡No hay problema! - Pensé en una (mejor) manera de hacerlo también, ver la actualización. –
¡genial! Todavía me estoy acostumbrando a moq, aceptaré tu respuesta tan pronto como SO lo permita – user1082693