Example #1
0
 public void SystemObject_GetTypeVraćaTipKlase()
 {
     SystemObject.IspisGetType();
     for (int i = 0; i < 3; ++i)
     {
         Type obj = cw.GetObject() as Type;
         Assert.IsNotNull(obj);
         Assert.AreEqual("MojaKlasa", obj.Name);
         Assert.AreEqual("Vsite.CSharp", obj.Namespace);
         Assert.AreEqual("System.Object", obj.BaseType.FullName);
         Assert.AreEqual(1, obj.GetConstructors().Length);
         Assert.AreEqual(4, obj.GetMethods().Length);
         var methodNames = obj.GetMethods().Select(mi => mi.Name);
         Assert.IsTrue(methodNames.Contains("ToString"));
         Assert.IsTrue(methodNames.Contains("GetType"));
         Assert.IsTrue(methodNames.Contains("GetHashCode"));
         Assert.IsTrue(methodNames.Contains("Equals"));
         Assert.AreEqual(0, obj.GetMethods(BindingFlags.Static).Count());
     }
 }