function assertCredential(provider, oauthParams, ref) {
  assertNotNullNorUndefined(ref);
  var parameters = provider.credential.getLastCall().getArguments();
  assertEquals(oauthParams.length, parameters.length);
  // Confirm the expected parameters passed when initializing the credential.
  for (var i = 0; i < parameters.length; i++) {
    assertEquals(oauthParams[i], parameters[i]);
  }
}
Asserts the credential is initialized with correct OAuth response.
@param {!Object} provider The provider object.
@param {!Array<string>} oauthParams The OAuth params used to initialize the
    credential.
@param {!Object} ref The credential reference.