If, however, you want to validate that the formula is calculating correctly as part of your test class - which is a very good idea if not something that we usually do - all you have to do is update the values of the fields that make up the formula, and then use system.assertEquals to validate that the formula returns the correct value.
Hi Anwar,
I think ur not able to cover the formula field in the test class.
its not need to write the formula field in the test class.
Just While inserting data in the test class.
please insert the field which give the out put of formula.
Ex:-field a+field b= field c(Formula field).
Ur test method will be like this :-
object o=new object(o.filed a=10,o.field b=20);
insert o;
It automatically covers the formula.
Thanks
Anil.B
If, however, you want to validate that the formula is calculating correctly as part of your test class - which is a very good idea if not something that we usually do - all you have to do is update the values of the fields that make up the formula, and then use system.assertEquals to validate that the formula returns the correct value.
Good luck!
Hi All,
Thanks For Replay
Thanks
Anwar