Ejemplo n.º 1
0
        public void GetAllInterfacesSunnyDay()
        {
            ImplementsTwoInterfaces instance = new ImplementsTwoInterfaces();

            Type[] interfaces = AopUtils.GetAllInterfaces(instance);
            Assert.IsNotNull(interfaces, "Must never return null.");
            Assert.AreEqual(2, interfaces.Length,
                            "Implements two interfaces.");
            ISet ifaces = new ListSet(interfaces);

            Assert.IsTrue(
                ifaces.ContainsAll(
                    new Type [] { typeof(IDisposable), typeof(ICloneable) }),
                "Did not find the correct interfaces.");
        }
Ejemplo n.º 2
0
 public void GetAllInterfacesSunnyDay()
 {
     ImplementsTwoInterfaces instance = new ImplementsTwoInterfaces();
     Type[] interfaces = AopUtils.GetAllInterfaces(instance);
     Assert.IsNotNull(interfaces, "Must never return null.");
     Assert.AreEqual(2, interfaces.Length,
                     "Implements two interfaces.");
     ISet ifaces = new ListSet(interfaces);
     Assert.IsTrue(
         ifaces.ContainsAll(
             new Type [] {typeof(IDisposable), typeof(ICloneable)}),
         "Did not find the correct interfaces.");
 }