public void Cref01() { var cref = new CRef("M:TestLibrary.SomeNamespace.Class6`1.#ctor(`0)"); var m = cref.ToMethod(); Assert.IsNotNull(m); }
public void ToMethod03() { var cref = new CRef("M:TestLibrary.SomeNamespace.Class1.Foo``4(``0,``1,``2)"); var method = cref.ToMethod(); Assert.IsNotNull(method); Assert.AreEqual("Foo", method.Name); }
public void Cref04() { var cref = new CRef("M:TestLibrary.SomeNamespace.Class3`2.#ctor(System.Collections.Generic.IDictionary{`0,`1})"); Assert.IsTrue(cref.IsMethod); var m = cref.ToMethod(); Assert.IsNotNull(m); }
public void Cref03() { var cref = new CRef("M:TestLibrary.SomeNamespace.Class7`2.#ctor(`0,`1)"); var m = cref.ToMethod(); Assert.IsNotNull(m); var paramArr = m.GetParameters(); Assert.AreEqual(2, paramArr.Length); }
public void ToMethod01() { var cref = new CRef("M:TestLibrary.SomeNamespace.Class1.#ctor"); Assert.IsTrue(cref.IsMethod); Assert.IsTrue(cref.IsConstructor); var method = cref.ToMethod(); Assert.IsNotNull(method); Assert.AreEqual(".ctor", method.Name); }
public void Cref02() { var crefs = new string[] { "M:TestLibrary.SomeNamespace.Class1.Foo``4(``0,``1,``2)", "M:TestLibrary.SomeNamespace.Class6`1.#ctor(`0)", }; foreach (var c in crefs) { var cref = new CRef(c); var m = cref.ToMethod(); Assert.IsNotNull(m, $"The string '{c}' must be a valid method reference."); } }