Esempio n. 1
0
        public static T Returns <T>(this T obj, T valueToReturn)
        {
            SubstituteContext.RegisterBehaviour(
                new ReturnsMethodBehaviour(valueToReturn));

            return(default(T));
        }
Esempio n. 2
0
        public static T Throws <T>(this T returnedValue, Exception exceptionToThrow)
        {
            SubstituteContext.RegisterBehaviour(
                new ThrowsMethodBehaviour(exceptionToThrow));

            return(default(T));
        }
Esempio n. 3
0
 public static void Do <T>(this T returnedValue, Func <object[], T> callback)
 {
     SubstituteContext.RegisterBehaviour(
         new DoMethodBehaviour <T>(callback));
 }