Exemplo n.º 1
0
        public void GetCustomAttributesFilterByType()
        {
            // Arrange
            ReflectedDelegatePatternActionDescriptor ad = GetActionDescriptor(_actionMethod);

            // Act
            object[] attributes = ad.GetCustomAttributes(typeof(OutputCacheAttribute), true /* inherit */);

            // Assert
            Assert.AreEqual(0, attributes.Length);
        }
Exemplo n.º 2
0
        public void GetCustomAttributes()
        {
            // Arrange
            ReflectedDelegatePatternActionDescriptor ad = GetActionDescriptor(_actionMethod);

            // Act
            object[] attributes = ad.GetCustomAttributes(true /* inherit */);

            // Assert
            Assert.AreEqual(1, attributes.Length);
            Assert.IsInstanceOfType(attributes[0], typeof(AuthorizeAttribute));
        }