Isolate.Fake.StaticMethods(typeof(AuthenticationAttempt<CustomUserLoginAttempt>)); // Some code calling the static method... Isolate.Verify.WasCalledWithArguments(() => AuthenticationAttempt<CustomUserLoginAttempt>.Log(null)). Matching(a => { CustomUserLoginAttempt loginAttempt = a[0] as CustomUserLoginAttempt; return loginAttempt.Attempts == 1; });
public class AuthenticationAttempt<T> where T : LoginAttemptInfo { public static void Log(T loginInfo) { loginInfo.CreateUserLoginAttempt(); } } public abstract class LoginAttemptInfo { public abstract void CreateUserLoginAttempt(); }