public void Reflex_GetPropertiesInfo_object_sinPropiedades_ret_null() { // Prepara ClasePruebaSinPropiedades objeto = new ClasePruebaSinPropiedades(); // Ejecuta List <PropertyInfo> pis = Reflex.GetPropertiesInfo(objeto); // Comprueba Assert.IsNull(pis); }
public void Reflex_GetPropertiesInfo_object_ret_ListPI() { // Prepara ClasePruebaSinPropiedadesFields objeto = new ClasePruebaSinPropiedadesFields { FieldBool = true, FieldDT = DateTime.MinValue, FieldInt = 0, FieldStr = string.Empty }; // Ejecuta List <PropertyInfo> pis = Reflex.GetPropertiesInfo(objeto); // Comprueba List <string> nombresProp = pis.ConvertAll(pi => pi.Name); Assert.IsTrue(nombresProp.IndexOf("FieldBool") >= 0); Assert.IsTrue(nombresProp.IndexOf("FieldDT") >= 0); Assert.IsTrue(nombresProp.IndexOf("FieldInt") >= 0); Assert.IsTrue(nombresProp.IndexOf("FieldStr") >= 0); }