Exemple #1
0
        public void TestEcmaDescToMD_NestedGenericGenericNested()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:Microsoft.ML.StaticPipe.TermStaticExtensions+ToKeyFitResult<System.ReadOnlyMemory<System.Char>>+OnFit");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"Microsoft.ML.StaticPipe.TermStaticExtensions.ToKeyFitResult`1?alt=TermStaticExtensions.ToKeyFitResult&text=TermStaticExtensions.ToKeyFitResult\" data-throw-if-not-resolved=\"True\"/>&lt;<xref href=\"System.ReadOnlyMemory`1?alt=System.ReadOnlyMemory&text=ReadOnlyMemory\" data-throw-if-not-resolved=\"True\"/>&lt;<xref href=\"System.Char?alt=System.Char&text=Char\" data-throw-if-not-resolved=\"True\"/>&gt;&gt;.<xref href=\"Microsoft.ML.StaticPipe.TermStaticExtensions.ToKeyFitResult`1.OnFit?alt=Microsoft.ML.StaticPipe.TermStaticExtensions.ToKeyFitResult`1.OnFit&text=OnFit\" data-throw-if-not-resolved=\"True\"/>";

            Assert.AreEqual(expected, md);
        }
Exemple #2
0
        public void TestEcmaDescToMD_NestedGeneric()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:Namespace.Class+NestedClass<Systen.String, Syste.IO.File>");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"Namespace.Class.NestedClass`2?alt=Class.NestedClass&text=Class.NestedClass\" data-throw-if-not-resolved=\"True\"/>&lt;<xref href=\"Systen.String?alt=Systen.String&text=String\" data-throw-if-not-resolved=\"True\"/>,<xref href=\"Syste.IO.File?alt=Syste.IO.File&text=File\" data-throw-if-not-resolved=\"True\"/>&gt;";

            Assert.AreEqual(expected, md);
        }
Exemple #3
0
        public void TestEcmaDescToMD_NestedNestedNested()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:Namespace.Class+NestedClass+NestedNestedClass");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"Namespace.Class.NestedClass.NestedNestedClass?alt=Namespace.Class.NestedClass.NestedNestedClass&text=Class.NestedClass.NestedNestedClass\" data-throw-if-not-resolved=\"True\"/>";

            Assert.AreEqual(expected, md);
        }
Exemple #4
0
        public void TestEcmaDescToMD_Generic()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:System.Collections.Generic.Dictionary<Systen.String, Syste.IO.File>");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"System.Collections.Generic.Dictionary`2?alt=System.Collections.Generic.Dictionary&text=Dictionary\" data-throw-if-not-resolved=\"True\"/>&lt;<xref href=\"Systen.String?alt=Systen.String&text=String\" data-throw-if-not-resolved=\"True\"/>,<xref href=\"Syste.IO.File?alt=Syste.IO.File&text=File\" data-throw-if-not-resolved=\"True\"/>&gt;";

            Assert.AreEqual(expected, md);
        }
Exemple #5
0
        public void TestEcmaDescToMD_GenericArray()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:System.Predicate<T[]>");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"System.Predicate`1?alt=System.Predicate&text=Predicate\" data-throw-if-not-resolved=\"True\"/>&lt;T[]&gt;";

            Assert.AreEqual(expected, md);
        }
Exemple #6
0
        public void TestEcmaDescToMD_GenericNestedArray()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:System.Collections.Generic.HashSet<T>+Enumerator[]");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"System.Collections.Generic.HashSet`1?alt=System.Collections.Generic.HashSet&text=HashSet\" data-throw-if-not-resolved=\"True\"/>&lt;T&gt;.<xref href=\"System.Collections.Generic.HashSet`1.Enumerator?alt=System.Collections.Generic.HashSet`1.Enumerator&text=Enumerator\" data-throw-if-not-resolved=\"True\"/>[]";

            Assert.AreEqual(expected, md);
        }
Exemple #7
0
        public void TestEcmaDescToMD_GenericNested()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:System.Collections.Generic.HashSet<Namespace.Class+NestedClass>");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"System.Collections.Generic.HashSet`1?alt=System.Collections.Generic.HashSet&text=HashSet\" data-throw-if-not-resolved=\"True\"/>&lt;<xref href=\"Namespace.Class.NestedClass?alt=Namespace.Class.NestedClass&text=Class.NestedClass\" data-throw-if-not-resolved=\"True\"/>&gt;";

            Assert.AreEqual(expected, md);
        }
Exemple #8
0
        public void TestEcmaDesc_Matrix()
        {
            EcmaUrlParser EcmaParser = new EcmaUrlParser();

            Monodoc.Ecma.EcmaDesc desc = EcmaParser.Parse("T:System.Predicate<T[,]>");
            var md       = SDPYamlConverter.DescToTypeMDString(desc);
            var expected = "<xref href=\"System.Predicate`1?alt=System.Predicate&text=Predicate\" data-throw-if-not-resolved=\"True\"/>&lt;T[,]&gt;";

            Assert.AreEqual(expected, md);

            desc     = EcmaParser.Parse("T:System.Management.Automation.Host.BufferCell[,,]");
            md       = SDPYamlConverter.DescToTypeMDString(desc);
            expected = "<xref href=\"System.Management.Automation.Host.BufferCell?alt=System.Management.Automation.Host.BufferCell&text=BufferCell\" data-throw-if-not-resolved=\"True\"/>[,,]";
            Assert.AreEqual(expected, md);
        }