You need to sign in to do that
Don't have an account?

get set test method coverage
Hi
I have a visualforce controller with the following kind of get method
// For error handling public Boolean error { get{ if(error == null) error = false; return error; } set; }
I want to cover these lines in my test method.I tried using .getError() but it says method doesn't exists or in correct signature. Can someone let me knowhow to cover these lines test method?
These would show up as a property, so just use the .error
MyController UUT = new MyController(); UUT.error = true; boolean TestError = UUT.error;
All Answers
Are these lines showing up as not covered when you run your test?
In my experience, defining getter/setter through this 'decoration' mechanism, means that the methods aren't available at compile/test time.
These would show up as a property, so just use the .error
MyController UUT = new MyController(); UUT.error = true; boolean TestError = UUT.error;