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."); }
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."); }