public static IReturnsResult <TMock> Completes <TMock>(this IReturns <TMock, Task> self) where TMock : class { return(self.Returns(Task.FromResult((object)null))); }
public static IReturnsThrows <TMock, TReturn> Returns <TMock, TReturn, TOut1, TOut2, TOut3, TResult>(this IReturns <TMock, TReturn> valueFunction, FuncWithOutThreeArgs <TOut1, TOut2, TOut3, TResult> action) where TMock : class { return(Returns(valueFunction, (object)action)); }
public static IReturnsResult <TMock> ReturnsAsync <TMock, T1>(this IReturns <TMock, Task> mock, Action <T1> action) where TMock : class { return(mock.Returns((T1 arg1) => { action(arg1); return Task.CompletedTask; })); }
public static IReturnsResult <TMock> CompletesWith <TMock, TRet>(this IReturns <TMock, Task <TRet> > self, TRet value) where TMock : class { return(self.Returns(Task.FromResult(value))); }
public static IReturnsResult <TMock> CompletesWithNull <TMock, TRet>(this IReturns <TMock, Task <TRet> > self) where TMock : class where TRet : class { return(self.Returns(Task.FromResult((TRet)null))); }
// Helper to get around Mock Returns((Type)null) weirdness. public static IReturnsResult <TMock> ReturnsNull <TMock, TRet>(this IReturns <TMock, TRet> self) where TMock : class where TRet : class { return(self.Returns((TRet)null)); }