It seems a little pointless that the method is invalid but accepts a parameter ref. It would probably be advisable to return the line:
public class FooBar {
internal string SomeMethod(ref string theStr) {
return theStr;
}
}
We also do it internaland specify the attribute InternalVisibleToin the AssemblyInfo.cs file:
[assembly: InternalsVisibleTo("Test.Assembly")]
This way it SomeMethodwill behave as if it were internal (i.e. not visible outside its assembly), with the exception of Test.Assembly, which will see it as public.
unit test ( , ref).
[Test]
public void SomeMethodShouldReturnSomething() {
Foobar foobar = new Foobar();
string actual;
foobar.SomeMethod(ref actual);
Assert.AreEqual("I'm the test your tests could smell like", actual);
}