public void XmlDocumentKeyTypeKeyTest() { Assert.AreEqual( "T:FixtureExplorerTest.XmlDocumenterTestClass", XmlDocumentKey.TypeKey(typeof(XmlDocumenterTestClass)) ); }
public void XmlDocumentKeyMethodBaseKeyPointerTest() { var c = typeof(XmlDocumenterTestClassUnsafe); var methodWithPointerParam = c.GetMethod("UnsafeMethod"); Assert.AreEqual( "M:FixtureExplorerTest.XmlDocumenterTestClassUnsafe.UnsafeMethod(System.Int32*)", XmlDocumentKey.MethodBaseKey(methodWithPointerParam) ); }
public void XmlDocumentKeyMethodBaseKeyNestedClassTest() { var testClass = typeof(XmlDocumenterTestClass.NestedClass); var voidConstructor = testClass.GetConstructor(Array.Empty <Type>()); Assert.AreEqual( "M:FixtureExplorerTest.XmlDocumenterTestClass.NestedClass.#ctor", XmlDocumentKey.MethodBaseKey(voidConstructor) ); }
public void XmlDocumentKeyTypeSpecTest() { Assert.AreEqual("System.String", XmlDocumentKey.TypeSpec(typeof(string), true)); Assert.AreEqual("System.Nullable{System.Int32}", XmlDocumentKey.TypeSpec(typeof(int?), true)); // strange one. The key reverses the dimensions, but that's per the specs. Assert.AreEqual("System.Int32[][0:,0:]", XmlDocumentKey.TypeSpec(typeof(int[, ][]), true)); Assert.AreEqual( "FixtureExplorerTest.XmlDocumenterTestClass.NestedClass", XmlDocumentKey.TypeSpec(typeof(XmlDocumenterTestClass.NestedClass), false) ); }
public void XmlDocumentKeyMethodBaseKeyPropertyTest() { var c = typeof(XmlDocumenterTestClass); var setArrayProperty = c.GetMethod("set_ArrayProperty"); Assert.AreEqual( "P:FixtureExplorerTest.XmlDocumenterTestClass.ArrayProperty", XmlDocumentKey.MethodBaseKey(setArrayProperty)); var getArrayProperty = c.GetMethod("get_ArrayProperty"); Assert.AreEqual( "P:FixtureExplorerTest.XmlDocumenterTestClass.ArrayProperty", XmlDocumentKey.MethodBaseKey(getArrayProperty) ); }
public void XmlDocumentKeyMethodBaseKeyTest() { var c = typeof(XmlDocumenterTestClass); var voidConstructor = c.GetConstructor(Array.Empty <Type>()); Assert.AreEqual( "M:FixtureExplorerTest.XmlDocumenterTestClass.#ctor", XmlDocumentKey.MethodBaseKey(voidConstructor) ); var nullableDoubleConstructor = c.GetConstructor(new[] { typeof(double?) }); Assert.AreEqual( "M:FixtureExplorerTest.XmlDocumenterTestClass.#ctor(System.Nullable{System.Double})", XmlDocumentKey.MethodBaseKey(nullableDoubleConstructor) ); var echoMethod = c.GetMethod("Echo"); Assert.AreEqual( "M:FixtureExplorerTest.XmlDocumenterTestClass.Echo(System.Object@)", XmlDocumentKey.MethodBaseKey(echoMethod) ); }
public void XmlDocumentKeyMethodBaseKeyNullMethodTest() { Assert.IsNull(XmlDocumentKey.MethodBaseKey(null)); }