コード例 #1
0
        public void GetAttributesForType_PropertyAttributes_IsNull()
        {
            // Arrange & Act
            var attributes = ModelAttributes.GetAttributesForType(typeof(BaseViewModel));

            // Assert
            Assert.Null(attributes.PropertyAttributes);
        }
コード例 #2
0
        public void GetAttributesForType_IncludesMetadataAttributes()
        {
            // Arrange & Act
            var attributes = ModelAttributes.GetAttributesForType(typeof(BaseViewModel));

            // Assert
            Assert.Single(attributes.Attributes.OfType <ClassValidator>());

            Assert.Single(attributes.TypeAttributes.OfType <ClassValidator>());
        }