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)); }
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"))); }
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); }
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); }
public void NestedClosedGenericType() { string aid = Naming.GetAssetId(typeof(GenericClass <string> .NestedGeneric <int>)); Assert.Equal("T:Company.Project.Library.GenericClass`1.NestedGeneric`1", aid); }
public void OpenGenericType() { Assert.Equal("T:System.Collections.Generic.List`1", Naming.GetAssetId(typeof(List <>))); }
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"))); }
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"))); }
public void MethodOnGenericClass() { Assert.Equal("M:Company.Project.AnotherLibrary.SpecialClass.ReturnsGeneric", Naming.GetAssetId(typeof(SpecialClass).GetMethod("ReturnsGeneric"))); }