Exemplo n.º 1
0
        public void CanGetClassNameFromClassDeclarationLine()
        {
            var    testLine = @".class public auto ansi beforefieldinit ExampleAssembly.AnotherExampleClass";
            string className;
            string templateSpecifcation;

            ILParseHelper.GetClassNameFromClassDeclarationLine(testLine, out className, out templateSpecifcation);
            Assert.AreEqual(@"ExampleAssembly.AnotherExampleClass", className);
        }
Exemplo n.º 2
0
        public void CanParseAnoymousTemplateClass()
        {
            var    testLine = @"  .class auto ansi sealed nested private beforefieldinit '<GetVisualChildren>d__0`1'<([WindowsBase]System.Windows.DependencyObject) T>";
            string className;
            string templateSpecifcation;

            ILParseHelper.GetClassNameFromClassDeclarationLine(testLine, out className, out templateSpecifcation);
            Assert.AreEqual(className, @"'<GetVisualChildren>d__0`1'");
            Assert.AreEqual(templateSpecifcation, @"<([WindowsBase]System.Windows.DependencyObject) T>");
        }