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

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

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