I have had occassion recently to have to set a class private variable in a class form a unit test.
[This was for settting _Id values in Model object which have no public setter].
this is how I did it:
Group testGroup = new Group();
Seller testSeller = new Seller();
Type t1 = testGroup.GetType();
FieldInfo fi = t1.GetField("_Id", BindingFlags.NonPublic | BindingFlags.Instance);
Type t2 = testSeller.GetType();
FieldInfo fi2 = t2.GetField("_Id", BindingFlags.NonPublic | BindingFlags.Instance);
fi.SetValue(testGroup, 20);
fi2.SetValue(testSeller, 20);