I have a private method like below:
int void SomeMethod(ref string theStr)
{
// Some Implementation
}
how to write the unit test case for this method.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Seems a bit pointless that a method is void but takes a
refparameter. It would probably make sense to make it return a string:We also make it
internaland specifyInternalVisibleToattribute in AssemblyInfo.cs file:This way
SomeMethodwill behave as though it’s internal (i.e. not visible outside its assembly) except for Test.Assembly, which will see it aspublic.The unit test is pretty trivial (regardless of whether or not it takes a
refparameter).