Exemplo n.º 1
0
        public void DisplayFormatSetsHasNonDefaultEditFormat(string propertyName, bool expectedHasNonDefaultEditFormat)
        {
            // Arrange
            AssociatedMetadataProvider provider = MakeProvider();

            // Act
            bool hasNonDefaultEditFormat = provider.GetMetadataForProperty(null, typeof(DisplayFormatModel), propertyName).HasNonDefaultEditFormat;

            // Assert
            Assert.Equal(expectedHasNonDefaultEditFormat, hasNonDefaultEditFormat);
        }
        public void DisplayFormatSetsHtmlEncode(string propertyName, bool expectedHtmlEncode)
        {
            // Arrange
            AssociatedMetadataProvider provider = MakeProvider();

            // Act
            bool htmlEncode = provider.GetMetadataForProperty(null, typeof(DisplayFormatModel), propertyName).HtmlEncode;

            // Assert
            Assert.Equal(expectedHtmlEncode, htmlEncode);
        }