Exemplo n.º 1
0
        public void OverriddenGenericMethod()
        {
            MethodInfo method = typeof(SpecialClass).GetMethods().First(m => m.Name == "ConsumesGeneric");

            Assert.Equal(
                "M:Company.Project.AnotherLibrary.SpecialClass.ConsumesGeneric(Company.Project.Library.RegularClass)",
                Naming.GetAssetId(method));
        }
Exemplo n.º 2
0
 public void ConversionOperator()
 {
     Assert.Equal(
         "M:Company.Project.Library.RegularClass.op_Explicit(Company.Project.Library.RegularClass)~System.Int64",
         Naming.GetAssetId(
             typeof(RegularClass).GetMethods(BindingFlags.Static | BindingFlags.Public)
             .First(p => p.Name == "op_Explicit")));
 }
Exemplo n.º 3
0
        public void ResolveGenericDictionary()
        {
            MsdnResolver resolver = new MsdnResolver();
            Uri          uri      = resolver.ResolveAssetId(Naming.GetAssetId(typeof(System.Collections.Generic.Dictionary <,>)), null);

            Debug.WriteLine(uri.ToString());
            Assert.NotNull(uri);
        }
Exemplo n.º 4
0
        public void MethodOnNestedClosedGenericType()
        {
            string aid =
                Naming.GetAssetId(
                    typeof(GenericClass <string> .NestedGeneric <int>).GetMethods().First(
                        m =>
                        m.Name.StartsWith
                            ("ConsumeP")));

            Assert.Equal("M:Company.Project.Library.GenericClass`1.NestedGeneric`1.ConsumeP(System.Int32)", aid);
        }
Exemplo n.º 5
0
        public void NestedClosedGenericType()
        {
            string aid = Naming.GetAssetId(typeof(GenericClass <string> .NestedGeneric <int>));

            Assert.Equal("T:Company.Project.Library.GenericClass`1.NestedGeneric`1", aid);
        }
Exemplo n.º 6
0
 public void OpenGenericType()
 {
     Assert.Equal("T:System.Collections.Generic.List`1",
                  Naming.GetAssetId(typeof(List <>)));
 }
Exemplo n.º 7
0
 public void OverriddenGenericMethod__WithGenericParameter()
 {
     Assert.Equal(
         "M:Company.Project.AnotherLibrary.InheritsSpecialClass.AnotherGeneric``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{Company.Project.Library.RegularClass},System.Collections.Generic.IEnumerable{System.Int32})",
         Naming.GetAssetId(typeof(InheritsSpecialClass).GetMethod("AnotherGeneric")));
 }
Exemplo n.º 8
0
 public void GenericMethodOnOpenGenericType_WithGenericParameter()
 {
     Assert.Equal(
         "M:Company.Project.Library.GenericClass`1.AnotherGeneric``1(System.Collections.Generic.IEnumerable{``0},System.Collections.Generic.IEnumerable{`0},System.Collections.Generic.IEnumerable{System.Int32})",
         Naming.GetAssetId(typeof(GenericClass <>).GetMethod("AnotherGeneric")));
 }
Exemplo n.º 9
0
 public void MethodOnGenericClass()
 {
     Assert.Equal("M:Company.Project.AnotherLibrary.SpecialClass.ReturnsGeneric",
                  Naming.GetAssetId(typeof(SpecialClass).GetMethod("ReturnsGeneric")));
 }