Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [seealldata]

The tag has no usage guidance.

1
vote
3answers
109 views

Is it necessary to SeeAllData in this case? Thoughts on Best Practice?

There's a lot of talk about SeeAllData being something to always avoid for best practice. My understanding is, if you're using it to test, for example, a Contact Trigger on a specific Contact, this is ...
1
vote
2answers
140 views

Test fails in destination Org with System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE

I've a test class for a controller which passes in the development Org but not in the destination/sandbox. Here's the error I get System.DmlException: Insert failed. First exception on row 0; first ...
0
votes
1answer
32 views

Query returning value from database and not test class

I'm having trouble with my code coverage and have a couple of hypothesis why this could be. My class: public class Tareas_Ordenador { public static void Ordenar(){ User Usuario = [Select Id ...
0
votes
1answer
66 views

Potential usecase for SeeAllData = true

As current api set default test class with SeeAllData=false and is advisable for us to use sample data,I am wondering what is ideal case for SeeAllData=true. I am planning to write test class that ...
2
votes
2answers
937 views

why need seeAllData = true in test class when use connectAPI

In my controller i'm using connectApi and my class functionality is working fine but the issue is when i'm using in my Test class (SeeAllData=true) it's covered 100% but seeAllData = true is not ...
0
votes
1answer
524 views

How to use Test.getStandardPricebookId for classes that automaticaly sync quotes

I was hopping to be able to remove the @seeAllData annotation from my tests by using Summer'14's addition - Test.getStandardPricebookId() but the test are failing with this error: System....
2
votes
1answer
268 views

How to avoid hard coding Id into a class?

I am running my test class but keep getting thrown this error INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY I have even added seealldata=true to try overcome this but want a more clean solution my ...
3
votes
1answer
535 views

SOQL returning org data in test class. Not using isTest(SeeAllData=true)

A method in my class I'm testing is suppose to return all users in the org, plus an extra user empty user at the beginning of the list. The reason for this is I wanted the default to be empty. @...
37
votes
4answers
1k views

Why Are Data Silos Important in Unit Tests?

I have a lot of strong opinions about this issue, but had a hard time finding official documents today to back up my position. A lot of times we say it is bad practice to use seeAllData=true, but we ...