Actually the answer is yes but not recommended. This problem came to my mind time ago at the start of selenium project. I used and end-up with many run time errors. If you use constructors then your test project will build without error but there can be run time error specially when calling it by other class.
First as a QA what we need to understand is why we are using unit test. Unit testing is testing the public states, behaviors, and interactions of testing objects. If you use private fields within constructors then what there to be test. In fact we need to use object orient concepts but better to keep the focus on simplicity.
First as a QA what we need to understand is why we are using unit test. Unit testing is testing the public states, behaviors, and interactions of testing objects. If you use private fields within constructors then what there to be test. In fact we need to use object orient concepts but better to keep the focus on simplicity.
Comments
Post a Comment