Skip to content

Instantly share code, notes, and snippets.

@DavidBasarab
Last active August 29, 2015 13:58
Show Gist options
  • Select an option

  • Save DavidBasarab/10395380 to your computer and use it in GitHub Desktop.

Select an option

Save DavidBasarab/10395380 to your computer and use it in GitHub Desktop.
Moq extensions to have the same call return in order different results.
internal static class MoqExtensions
{
public static void ReturnsInOrder<T, TResult>(this ISetup<T, TResult> setup, params TResult[] results) where T : class
{
setup.Returns(new Queue<TResult>(results).Dequeue);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment