Пример #1
0
 // commenting out this method allowed the project to compile without the reference to EF
 public static IReturnsResult <T> ReturnsSet <T, TProperty, TEntity>(this ISetupGetter <T, TProperty> setupGetter, params TEntity[] data)
     where T : class
     where TProperty : IDbSet <TEntity>
     where TEntity : class, new()
 {
     return(setupGetter.Returns((TProperty)DbSet(data)));
 }
Пример #2
0
        public static void ReturnsInOrder <T, TResult>(this ISetupGetter <T, TResult> setup, params object[] results) where T : class
        {
            var queue = new Queue(results);

            setup.Returns(() =>
            {
                var result = queue.Dequeue();
                if (result is Exception)
                {
                    throw result as Exception;
                }
                return((TResult)result);
            });
        }
Пример #3
0
 public StubSetup <TInterface, TProperty> Returns(TProperty value)
 {
     _getter.Returns(value);
     return(this);
 }
 public FluentMock<T> Returns(TProperty result)
 {
     m_setup.Returns(result);
     return m_mock;
 }
Пример #5
0
 internal static void ReturnsAsync <TMock, TResult>(this ISetupGetter <TMock, Task <TResult> > mock, TResult result) where TMock : class
 {
     mock.Returns(Task.FromResult(result));
 }