Ejemplo n.º 1
0
		static string[] DescribeProperties(PropertyInfo[] pi)
		{
			string[] result = null;
			string mods;
			PropertyInfo p;
			result = new string[pi.Count()];

			for (int i = 0; i < pi.Count(); i++)
			{
				p = pi[i];
				mods = "";
				if (p.CanRead)
				{
					mods = mods + "get; ";
				}
				if (p.CanWrite)
				{
					mods = mods + "set; ";
				}

				result[i] = string.Format("{0} {1} {2} {3}{4}", p.PropertyType, p.Name, "{", mods, "}");
			}

			return result;
		}
Ejemplo n.º 2
0
 private static void VerifyPropertiesEquality(PropertyInfo[] properties1, PropertyInfo[] properties2)
 {
     if (TestHelper.AreNotNull(properties1, properties2))
     {
         Assert.AreEqual(properties1.Count(), properties2.Count());
         foreach (PropertyInfo prop1 in properties1)
         {
             PropertyInfo prop2 = properties2.First(p => p.Name == prop1.Name);
             Assert.IsNotNull(prop2);
             Assert.IsTrue(AreTypesEqual(prop1.PropertyType, prop2.PropertyType));
             TestHelper.VerifyAttributesEquality(prop1.GetCustomAttributesData(), prop2.GetCustomAttributesData());
         }
     }
 }