Mock.Get( map )
.Setup( i => i.GetItem( It.IsAny<int>(), It.IsAny<int>() ) )
.Returns<int, int>( (x, y) => itemCoords.Contains( new Vector2i( x, y ) ) ? item : null );
--
--
Post: moq...@googlegroups.com
Unsubscribe: moqdisc-unsubscribe@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Moq Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moqdisc+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I rewrote to this:
foreach (var i in items) {
mock.Setup( x => x.GetItem( i.x, i.y ) ).Returns<int, int>( (x, y) => item );
}