Home / Expert Answers / Computer Science / hi-i-39-m-new-to-apex-so-i-recently-was-testing-some-apex-code-with-the-istest-i-now-this-tests-the-pa428

(Solved): Hi, I'm new to apex. So I recently was testing some apex code with the @Istest. I now this tests the ...



Hi, I'm new to apex. So I recently was testing some apex code with the @Istest. I now this tests the coverage of the data. When I was looking up more into this topic, I see that people use @testsetup. What exactly does @testsetup do? Why couldn't I just use @istest a bunch of times. Whats the benefit of @testsetup? I tried applying @testsetup by itself, but it does nothing.



We have an Answer from Expert

View Expert Answer

Expert Answer


@testsetup: @testSetup is an annotation that is used in Apex tests to pre-load test data before a test runs. It can be used to create data that is nee
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe