Skip to content

Instantly share code, notes, and snippets.

@BanksySan
Created February 26, 2015 11:58
Show Gist options
  • Save BanksySan/dc8170f9a50a61dbd95b to your computer and use it in GitHub Desktop.
Save BanksySan/dc8170f9a50a61dbd95b to your computer and use it in GitHub Desktop.
Moq Extensions
namespace BanksySan.Logging.Tests.Helpers
{
using System.Collections.Generic;
using Moq.Language.Flow;
public 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);
}
public static void ReturnsInOrder<T, TResult>(
this ISetupGetter<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