You need to sign in to do that
Don't have an account?
SOSL query not returning values when used in testMethods
Here is the code but it appears the SOSL query is not returning the account that was just inserted:
Any ideas?
Code:
public class soslTest { public static testMethod void SOSLtest(){ Account acct = new Account( Name = 'Test Account' ); insert acct; List<List<SObject>> searchList = [FIND '*Test Account*' IN NAME FIELDS RETURNING Account(Id, name)]; Account [] accounts = ((List<Account>)searchList[0]); system.debug('Accounts ' + accounts); } }
//And the debug line:
20080610183243.419:Class.soslTest.SOSLtest: line 12, column 9: Accounts ()
Any ideas?
-Jason