Esempio n. 1
0
 public void XmlDocumentKeyTypeKeyTest()
 {
     Assert.AreEqual(
         "T:FixtureExplorerTest.XmlDocumenterTestClass",
         XmlDocumentKey.TypeKey(typeof(XmlDocumenterTestClass))
         );
 }
Esempio n. 2
0
        public void XmlDocumentKeyMethodBaseKeyPointerTest()
        {
            var c = typeof(XmlDocumenterTestClassUnsafe);
            var methodWithPointerParam = c.GetMethod("UnsafeMethod");

            Assert.AreEqual(
                "M:FixtureExplorerTest.XmlDocumenterTestClassUnsafe.UnsafeMethod(System.Int32*)",
                XmlDocumentKey.MethodBaseKey(methodWithPointerParam)
                );
        }
Esempio n. 3
0
        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)
                );
        }
Esempio n. 4
0
 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)
         );
 }
Esempio n. 5
0
        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)
                );
        }
Esempio n. 6
0
        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)
                );
        }
Esempio n. 7
0
 public void XmlDocumentKeyMethodBaseKeyNullMethodTest()
 {
     Assert.IsNull(XmlDocumentKey.MethodBaseKey(null));
 }