c# - Test cases to check if one string is present in another -


i had question in interview write test cases test function checks if 1 string present in didn't quite expect question pop in interview developer position, yesterday got heads on-site visit same company wanted pointers testing folks here idea (before head there) go answering type of questions. skeleton provided function ask me test it.

public static boolean checksubstring(string str1, string str2)     {         //first string source             // second string reference         if(str1.contains(str2))             return true;         else             return false;     } 

thanks reading. forward replies eagerly.

just 1 tip: consider part: str1.contains(str2), when result in true, when in false , needed make throw exception.

that test cases.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -