Пример #1
0
        public void GetAllInterfacesWithObjectThatInheritsInterfaces()
        {
            InheritsOneInterface instance = new InheritsOneInterface();

            Type[] interfaces = AopUtils.GetAllInterfaces(instance);
            Assert.IsNotNull(interfaces, "Must never return null.");
            Assert.AreEqual(1, interfaces.Length,
                            "Inherited one interface from superclass.");
            Type iface = interfaces[0];

            Assert.IsNotNull(iface, "Returned interface cannot be null.");
            Assert.AreEqual(typeof(IDisposable), iface, "Wrong interface returned.");
        }
Пример #2
0
 public void GetAllInterfacesWithObjectThatInheritsInterfaces()
 {
     InheritsOneInterface instance = new InheritsOneInterface();
     Type[] interfaces = AopUtils.GetAllInterfaces(instance);
     Assert.IsNotNull(interfaces, "Must never return null.");
     Assert.AreEqual(1, interfaces.Length,
                     "Inherited one interface from superclass.");
     Type iface = interfaces[0];
     Assert.IsNotNull(iface, "Returned interface cannot be null.");
     Assert.AreEqual(typeof(IDisposable), iface, "Wrong interface returned.");
 }