Suppose that you have a class with various non-public fields, e.g., the class named ClassToTest below servers as a good example.
public class ClassToTest { public int SomeNumber { get; set; } private int m_somePrivateProperty { get; set; } private int m_somePrivateVar; private static int s_someStaticNumber; } And suppose that we desire to assign some value to the private variable m_somePrivateVar, and the private property m_somePrivateProperty. The approach is to iterate through the fields of the ClassToTest type to find the desired field.