-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should Account unit test set an account name? #170
Comments
Unfortunately the tool is generic and does not know about the requirements of every object, standard or custom, the generated test really only needs the record to fire the before phase of its trigger, not for the record to insert, however in your case your trigger won't tolerate required fields not being entered (which are not enforced outside of the UI). There is another open issue that speaks about my adding support to allow the rollup definition to contain some default dummy values that will be injected into the test to help with these scenarios. So the answer is no, to this question, but yes to the tool helping support this use case better. I'll add another comment to issue 122 above. |
Yes that might add some intelligence to it i agree. For sure worth exploring this, as i don't want to make the tool anymore complicated for the end user if possible. But then i suspect even with some intelligence there will always be corner cases, so i think some raw mode to led devs modify the generated code (perhaps a field on the rollup) which avoids having to break out into dev tools and deployment etc is the ultimate fall back. |
Closing this, as i think the general issue is well covered in 122 |
I'm hitting a unit test error on dlrs_AccountTest because I have a trigger method that assumes Account.Name will be set to a non-null string value.
For now I'll be fixing my method to handle that situation.
But, Account.Name is a required field, is it not? Shouldn't your unit test set a dummy value for that field?
The text was updated successfully, but these errors were encountered: