1
Answer

Test case for constructor as I have to do filter logic

kamila

kamila

6y
521
1
  1. public Myclass {  
  2. public Myclass(AnotherClass obj)    
  3. {    
  4. _key = obj.key;    
  5. _ID = obj.ID;    
  6. _CandidateMode = obj.CandidateMode;    
  7. if(_CandidateMode == obj.CandidateMode.numeric     
  8. {    
  9. //Dosomething    
  10. }    
  11. else    
  12. {    
  13. //Do something with special character.    
  14. }    
  15. }    
  16. }  
I have constructor which does some logic and gets data in adds the data list to a method call. Can anyone give some inputs of handling the logic as test case.
Answers (1)