You need to sign in to do that
Don't have an account?
@isTest(SeeAllData=false) annotation not working
If @isTest(SeeAllData=false) working for anyone?
I have annotated the class as well as the method but the testmethod can see the existing data.
Here is simple code snippet. Assertion is getting failed for me...
@isTest(SeeAllData=false)
private class testAnnotationSeeAllData {
static testmethod void myUnitTest()
{
Test.startTest();
List<User> lstUsers = [Select Id, Name From User Where IsActive= true Limit 100];
System.assert(lstUsers.size() == 0);
Test.stopTest();
}
}
tried in api version 24 and 25 both. and Developer Org and Sandbox.
is there anyone who is experiencing the same problem?
Users aren't considered data for this purpose. The following doc page:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_data_access.htm
details which data will still be visible to your test - user is on that list.
All Answers
Users aren't considered data for this purpose. The following doc page:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_testing_data_access.htm
details which data will still be visible to your test - user is on that list.
Hi Bob,
I don't know if you'll still read this, but I have a case (08933438 and 08943094) about a bug with seeAllData I think I have found. Two tests doing exactly the same this, one has see all data and passes, the other does not and fails.
Could you confirm this is expected behaviour (as support is claiming). Because it doesn't look like to to me.