kamila

kamila

  • NA
  • 10
  • 0

Test case for constructor as I have to do filter logic

Apr 24 2018 6:11 AM
  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)