Esempio n. 1
0
 /// <summary>
 /// Casts the specified fake object to the specified interface type, if
 /// the fake does not already implment the interface it will be implemented.
 /// </summary>
 /// <param name="fakedObject">The faked object to cast.</param>
 /// <typeparam name="T">The type of interface to implement.</typeparam>
 /// <returns>The faked object cast to the specified interface type.</returns>
 /// <exception cref="ArgumentException">The specified type is not an interface type.</exception>
 /// <exception cref="ArgumentNullException">The interfaceType parameter is null or the fakedObject parameter is null.</exception>
 public static T CastTo <T>(object fakedObject) where T : class
 {
     Fake.CastTo(typeof(T), fakedObject);
     return((T)fakedObject);
 }