internal static ConfiguredCall Returns <T>(MatchArgs matchArgs, T returnThis, params T[] returnThese)
        {
            var     context = SubstitutionContext.Current;
            IReturn returnValue;

            if (returnThese == null || returnThese.Length == 0)
            {
                returnValue = new ReturnValue(returnThis);
            }
            else
            {
                returnValue = new ReturnMultipleValues <T>(new[] { returnThis }.Concat(returnThese).ToArray());
            }
            return(context.LastCallShouldReturn(returnValue, matchArgs));
        }
Esempio n. 2
0
        private static void Returns <T>(MatchArgs matchArgs, T returnThis, params T[] returnThese)
        {
            var     context = SubstitutionContext.Current;
            IReturn returnValue;

            if (returnThese == null || returnThese.Length == 0)
            {
                returnValue = new ReturnValue(returnThis);
            }
            else
            {
                returnValue = new ReturnMultipleValues <T>(new[] { returnThis }.Concat(returnThese));
            }
            context.LastCallShouldReturn(returnValue, matchArgs);
        }
Esempio n. 3
0
        private static ConfiguredCall ConfigureReturn <T>(MatchArgs matchArgs, T returnThis, T[] returnThese)
        {
            IReturn returnValue;

            if (returnThese == null || returnThese.Length == 0)
            {
                returnValue = new ReturnValue(returnThis);
            }
            else
            {
                returnValue = new ReturnMultipleValues <T>(new[] { returnThis }.Concat(returnThese).ToArray());
            }
            return(SubstitutionContext
                   .Current
                   .ThreadContext
                   .LastCallShouldReturn(returnValue, matchArgs));
        }