I am convinced of the usefulness of unit tests, but I really don't understand the rules for them.
If I have a class associated with another
public class MyClass
{
private SecondClass MySecondClass;
public MyClass()
{
this.MySecondClass = new SecondClass ();
}
}
the field is private, and Myclass has this method:
public ThirdClass Get()
{
return this.MySecondClass.Get();
}
How can I check this? I guess I need to check if the method is suitable MyClass.get() MySecondClass.Get()! But I can not make fun of SecondClassand assign it to the first, because it is a private field. So I'm really curious how you can verify this.
thank
user399356
source
share