コード例 #1
0
        public void Format_property_name_full_name_indexer_format_compact_parameters()
        {
            var pi = typeof(string).GetTypeInfo().GetProperty("Chars");
            var pn = PropertyName.FromPropertyInfo(pi);

            MetadataNameFormat format = new MetadataNameFormat();

            format.DefaultFormatString[SymbolType.Parameter] = "Cv";
            format.IncludeReturnTypes[SymbolType.Property]   = true;

            // Uses the parameter format string for return type
            string expected = "System.String.Chars[Int32]:Char";

            Assert.Equal(expected, format.Format(pn));
            Assert.Equal(expected, pn.ToString(null, format));
        }