Пример #1
0
        public void Combine_should_qualify_namespace_name_with_other()
        {
            var actual = MetadataName.Combine(
                NamespaceName.Parse("System"),
                NamespaceName.Parse("IO")
                );

            Assert.Equal(SymbolType.Namespace, actual.SymbolType);
            Assert.Equal("System.IO", actual.FullName);
        }
Пример #2
0
        public void Combine_should_combine_nested_type_ns()
        {
            var actual = MetadataName.Combine(
                NamespaceName.Parse("System"),
                TypeName.Parse("String+Enumerator")
                );

            Assert.Equal(SymbolType.Type, actual.SymbolType);
            Assert.Equal("System.String+Enumerator", actual.FullName);
        }
Пример #3
0
        public void Combine_should_qualify_type_with_namespace_name()
        {
            var actual = MetadataName.Combine(
                TypeName.Parse("String"),
                TypeName.Parse("Enumerator")
                );

            Assert.Equal(SymbolType.Type, actual.SymbolType);
            Assert.Equal("String+Enumerator", actual.FullName);
        }
Пример #4
0
        public void Combine_should_qualify_type_with_assembly()
        {
            var actual = MetadataName.Combine(
                AssemblyName.Parse("mscorlib"),
                TypeName.Parse("String")
                );

            Assert.Equal(SymbolType.Type, actual.SymbolType);
            Assert.Equal("String, mscorlib", ((TypeName)actual).AssemblyQualifiedName);
        }
Пример #5
0
        public void Combine_should_qualify_member_with_type(SymbolType symbolType)
        {
            var actual = MetadataName.Combine(
                TypeName.Parse("String"),
                SymbolName.Parse("Length").ConvertTo(symbolType)
                );

            Assert.Equal(symbolType, actual.SymbolType);
            Assert.Equal("String.Length", actual.FullName);
        }
Пример #6
0
        public void Combine_should_qualify_list_of_names()
        {
            var actual = MetadataName.Combine(
                AssemblyName.Parse("mscorlib"),
                NamespaceName.Parse("System"),
                TypeName.Parse("String"),
                TypeName.Parse("Enumerator")
                );

            Assert.Equal(SymbolType.Type, actual.SymbolType);
            Assert.Equal("System.String+Enumerator, mscorlib", ((TypeName)actual).AssemblyQualifiedName);
        }