function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lionel_CastroLionel_Castro 

Testing Object and Field Level Security Enforcement

Hi All,
I'm submitting my package to AppExchange Security Review and I've a doubt…
I need check the Fields Level Security in Test class also?
Thanks!


 
Best Answer chosen by Lionel_Castro
Carolina Ruiz MedinaCarolina Ruiz Medina
hi Juanpe,

If you have code that is checking Field Level security  ( you need to have the code if you want to pass sec review :) ) then you will need to test it.

I would recomend to test all the cases. Therefore my answer would be yes you need to have test clas for the code that is written that is checking field level security. Also in order to make a package you need 75% minimum ( however I would recommend to try to get  100 )

Now, if you feel that you already have 75% and you dont want to test your code is totally up to you.  ( I wouldn't leave code without test if possible please) 

But!!! As a developer I would highly recomment to test your code the most posible, to know that no cases are going to break your app. A good technique on testing is TDD. Test Driven Development. 

Everytime that we don't write tests for an app a little kitten die :P 

Hope it helps!! 

Thanks,
Carolina. 



 

All Answers

Carolina Ruiz MedinaCarolina Ruiz Medina
hi Juanpe,

If you have code that is checking Field Level security  ( you need to have the code if you want to pass sec review :) ) then you will need to test it.

I would recomend to test all the cases. Therefore my answer would be yes you need to have test clas for the code that is written that is checking field level security. Also in order to make a package you need 75% minimum ( however I would recommend to try to get  100 )

Now, if you feel that you already have 75% and you dont want to test your code is totally up to you.  ( I wouldn't leave code without test if possible please) 

But!!! As a developer I would highly recomment to test your code the most posible, to know that no cases are going to break your app. A good technique on testing is TDD. Test Driven Development. 

Everytime that we don't write tests for an app a little kitten die :P 

Hope it helps!! 

Thanks,
Carolina. 



 
This was selected as the best answer
Lionel_CastroLionel_Castro
Thanks Carolina!!

I will try to have 75%, I promise... :)