I have a mock (using Moq) that takes in an IEnumerable<T> and return an item from that collection (T). When trying to set up a mock, I run into this issue:
mockCollectionsSelector.SetupSequence(s => s.SelectRandomFrom<Feat>(It.Is<IEnumerable<Feat>>(fs => fs.All(f => f.Name == FeatConstants.FavoredEnemy))))
.Returns((IEnumerable<Feat> fs) => fs.ElementAt(1))
Cannot convert lambda expression because it is not a delegate type
All the examples of referencing parameters in Moq have the same return type as what was passed in, so this might not even be possible - and if so, then I will have to find a different way to do this. Otherwise, I am not sure what I am doing wrong here.