Which code snippet will assert that the remote action returned the correct Account?

global with sharing class MyRemoter { public String accountName { get; set; } public static Account account { get; set; } public AccountRemoter() {}
@RemoteAction global static Account getAccount(String accountName) { account = [SELECT Id, Name, NumberOfEmployees
FROM Account WHERE Name = :accountName]; return account;
} }
Consider the Apex class above that defines a RemoteAction used on a Visualforce search page.
Which code snippet will assert that the remote action returned the correct Account?
A. Account a = controller.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );
B. MyRemoter remote = new MyRemoter();
Account a = remote.getAccount(‘TestAccount’);
System.assertEquals( ‘TestAccount’, a.Name );
C. MyRemoter remote = new MyRemoter(‘TestAccount’);
Account a = remote.getAccount ();
System.assertEquals( ‘TestAccount’, a.Name );
D. Account a = MyRemoter.getAccount(‘TestAccount’); System.assertEquals( ‘TestAccount’, a.Name );

How To Pass Certified Platform Developer II Exam?

Certified Platform Developer II PDF dumps.

High quality Certified Platform Developer II pdf and software. VALID exam to help you pass.

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.