There is a class, it has a property and a constructor
public class Pen { private int inkContainerValue = 1000; public Pen(int inkContainerValue) { this.inkContainerValue = inkContainerValue; } In a third-party class, I create an object of this class and I want to know what type of variable inkContainerValue how to implement it?
Assert.AreEqual("Тип переменной которое мы получим","Предполагаемый тип переменной"- Pavel KushnerevichPen pen = new Pen(inkContainerValueTes); Type myType = typeof(Pen); PropertyInfo myPropInfo = myType.GetProperty("inkContainerValue"); //assert Assert.AreEqual(myPropInfo.Name, actual);Pen pen = new Pen(inkContainerValueTes); Type myType = typeof(Pen); PropertyInfo myPropInfo = myType.GetProperty("inkContainerValue"); //assert Assert.AreEqual(myPropInfo.Name, actual);, but apparently did not quite understand howPropertyInfo myPropInfo = myType.GetProperty("inkContainerValue");Works - Pavel Kushnerevich